Edit Orders for Zen Cart®

Version 4.5.0. Copyright © 2015-2019, Vinos de Frutas Tropicales.

Current Support Thread on the Zen Cart forums: https://www.zen-cart.com/showthread.php?200407

Released under the General Public License (see the file named LICENSE in the plugin's distribution for full details). This script is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Usage Notes:

  1. A working copy of Zen Cart (v1.5.5a or later) is required by Edit Orders.
  2. Some order-total modules are incompatibile with EO, especially if they require storefront conditions to perform their processing.
  3. Products added to an order via EO cannot include a "file-upload" option as that option-type is not currently supported.

Edit Orders (EO) is a Zen Cart admin module that allows administrative users to edit a customer's order to:

  • Change the customer, billing or shipping information
  • Add, delete, and edit products in an order
  • Update product quantities and pricing
  • Modify product attributes
  • Add, delete, and edit order totals

This section identifies the processes you'll use to initially install Edit Orders, upgrade or uninstall EO entirely.

Notes:

  1. Before you install EO v4.2.0 (or later), you'll need a working copy of Zen Cart 1.5.5a or later.
  2. EO, v4.4.0 and later, requires that the base Zen Cart function zen_add_tax (present in /YOUR_ADMIN/includes/functions/general.php) not pre-round its return value. Refer to this tab for more information.
  3. Edit Orders provides an additional admin-sanitization script so that its inputs don't get over-sanitized by the zc155+ sanitizer. This, unfortunately, affects stores that have both EO installed and a cron-job set up to run the /admin/currency_cron.php script; see this Zen Cart issue for details.

If your store uses a version of Zen Cart prior to 1.5.6, there are core-file overwrites required by this plugin; you should always backup your cart's database and files prior to making any changes. Unzip the plugin's package file and then:

  1. Rename the YOUR_ADMIN sub-directory to match your custom admin sub-directory's name.
  2. If your store uses a version of Zen Cart prior to 1.5.6, you'll need to merge any pre-existing core-file changes with the changes required by Edit Orders. Each of these files is located in the zc155 of EO's distribution, providing the in-core zc156 notifications required:
    1. /includes/classes/order.php (2 marked change-sections)
    2. /includes/modules/order_total/ot_shipping.php (This is the zc156b version of the file)
    3. /YOUR_ADMIN/orders.php (3 marked change-sections)
    After you've merged your pre-existing changes into the files, copy them to your store's file-system (renaming the YOUR_ADMIN sub-directory to match your store's admin-directory name).
  3. Sign into your Zen Cart's admin panel.
  4. Copy the plugin's files to your store's directory structure:
    1. /includes/auto_loaders/config.vinos_common.php
    2. /includes/classes/VinosAutoload.php (Added in v4.2.0)
    3. /includes/classes/vinos/common/NotiferCheck.php (Added in v4.2.0)
    4. /includes/init_includes/init_vinos_autoload.php (Added in v4.2.0)
    5. /includes/languages/english/modules/order_total/ot_onetime_discount.php
    6. /includes/languages/english/modules/order_total/ot_misc_cost.php
    7. /includes/modules/order_total/ot_onetime_discount.php
    8. /includes/modules/order_total/ot_misc_cost.php
    9. /YOUR_ADMIN/edit_orders.php
    10. /YOUR_ADMIN/images/icon_billing.png
    11. /YOUR_ADMIN/images/icon_comment_add.png
    12. /YOUR_ADMIN/images/icon_customers.png
    13. /YOUR_ADMIN/images/icon_details.gif
    14. /YOUR_ADMIN/images/icon_shipping.png
    15. /YOUR_ADMIN/images/icon_track_add.png
    16. /YOUR_ADMIN/includes/edit_orders.css
    17. /YOUR_ADMIN/includes/auto_loaders/config.eo.php
    18. /YOUR_ADMIN/includes/auto_loaders/config.vinos_common_admin.php (Added in v4.2.0)
    19. /YOUR_ADMIN/includes/classes/attributes.php
    20. /YOUR_ADMIN/includes/classes/editOrders.php
    21. /YOUR_ADMIN/includes/classes/EditOrdersQueryCache.php
    22. /YOUR_ADMIN/includes/classes/mock_cart.php
    23. /YOUR_ADMIN/includes/classes/EditOrdersAdminObserver.php (Added in v4.2.0)
    24. /YOUR_ADMIN/includes/extra_configures/edit_orders.php (Non-processing module, can be safely removed)
    25. /YOUR_ADMIN/includes/extra_datafiles/edit_orders_defines.php
    26. /YOUR_ADMIN/includes/extra_datafiles/eo_sanitization.php
    27. /YOUR_ADMIN/includes/functions/extra_functions/common_orders_functions.php (Non-processing module, can be safely removed)
    28. /YOUR_ADMIN/includes/functions/extra_functions/edit_orders_functions.php
    29. /YOUR_ADMIN/includesinit_includes/init_eo_config.php
    30. /YOUR_ADMIN/includes/languages/english/edit_orders.php
    31. /YOUR_ADMIN/includes/languages/english/extra_definitions/edit_orders.php
    32. /YOUR_ADMIN/includes/languages/english/images/buttons/button_add_product.gif
  5. Click the "Admin Home" link in your Zen Cart's top admin menu. This action will cause the plugin's installation script to run.

First, delete the files that were copied to your Zen Cart's file-system, then copy the contents of the plugin's /docs/edit_orders/uninstall/uninstall_eo.sql to your clipboard and paste into your admin's Tools->Install SQL Patches to complete the uninstall process.

The installation for Edit Orders changed drastically for v4.2.0 and later. Following is a "secret decoder ring" to let you where files from those earlier releases have been moved (or removed) in the v4.2.0 or later distributions of EO:

EO v4.1.7 or earlier EO v4.2.0 or later
/1_modified_core_files/includes/classes/order.php/includes/classes/order.php
/1_modified_core_files/includes/classes/order_total.php
/1_modified_core_files/includes/classes/shipping.php
/1_modified_core_files/your_admin_folder/orders.php/YOUR_ADMIN/orders.php
/1_modified_core_files/your_admin_folder/images/icon_edit.gif
/1_modified_core_files/your_admin_folder/includes/languages/english/orders.php
/2_new_files/your_admin_folder/edit_orders.php/YOUR_ADMIN/edit_orders.php
/2_new_files/your_admin_folder/images/icon_billing.png/YOUR_ADMIN/images/icon_billing.png
/2_new_files/your_admin_folder/images/icon_comment_add.png/YOUR_ADMIN/images/icon_comment_add.png
/2_new_files/your_admin_folder/images/icons/icon_customers.png/YOUR_ADMIN/images/icon_customers.png
/2_new_files/your_admin_folder/images/icon_details.gif/YOUR_ADMIN/images/icon_details.gif
/2_new_files/your_admin_folder/images/icon_invoice.gif
/2_new_files/your_admin_folder/images/icon_shipping.png/YOUR_ADMIN/images/icon_shipping.png
/2_new_files/your_admin_folder/images/icon_track_add.png/YOUR_ADMIN/images/icon_track_add.png
/2_new_files/your_admin_folder/includes/edit_orders.css/YOUR_ADMIN/includes/edit_orders.css
/2_new_files/your_admin_folder/includes/auto_loaders/config.eo.php/YOUR_ADMIN/includes/auto_loaders/config.eo.php
/2_new_files/your_admin_folder/includes/auto_loaders/config.zc154_compatibility.php
/2_new_files/your_admin_folder/includes/classes/attributes.php/YOUR_ADMIN/includes/classes/attributes.php
/2_new_files/your_admin_folder/includes/classes/editOrders.php/YOUR_ADMIN/includes/classes/editOrders.php
/2_new_files/your_admin_folder/includes/classes/EditOrdersQueryCache.php/YOUR_ADMIN/includes/classes/EditOrdersQueryCache.php
/2_new_files/your_admin_folder/includes/classes/eo_plugin.php
/2_new_files/your_admin_folder/includes/classes/mock_cart.php/YOUR_ADMIN/includes/classes/mock_cart.php
/2_new_files/your_admin_folder/includes/classes/plugin.php
/2_new_files/your_admin_folder/includes/extra_configures/edit_orders.php/YOUR_ADMIN/includes/extra_configures/edit_orders.php (Placeholder, can be removed)
/2_new_files/your_admin_folder/includes/extra_datafiles/edit_orders_defines.php (Placeholder, can be removed)/YOUR_ADMIN/includes/extra_datafiles/edit_orders_defines.php
/2_new_files/your_admin_folder/includes/extra_datafiles/eo_sanitization.php/YOUR_ADMIN/includes/extra_datafiles/eo_sanitization.php
/2_new_files/your_admin_folder/includes/functions/extra_functions/common_orders_functions.php (Placeholder, can be removed)/YOUR_ADMIN/includes/functions/extra_functions/common_orders_functions.php (Placeholder, can be removed)
/2_new_files/your_admin_folder/includes/functions/extra_functions/edit_orders_functions.php/YOUR_ADMIN/includes/functions/extra_functions/edit_orders_functions.php
/2_new_files/your_admin_folder/includes/init_includes/init_eo_config.php/YOUR_ADMIN/includes/init_includes/init_eo_config.php
/2_new_files/your_admin_folder/includes/init_includes/init_zc154_compatibility.php
/2_new_files/your_admin_folder/includes/languages/english/edit_orders.php/YOUR_ADMIN/includes/languages/english/edit_orders.php
/2_new_files/your_admin_folder/includes/languages/english/extra_definitions/edit_orders.php/YOUR_ADMIN/includes/languages/english/extra_definitions/edit_orders.php
/2_new_files/your_admin_folder/includes/languages/english/images/buttons/button_add_product.gif/YOUR_ADMIN/includes/languages/english/images/buttons/button_add_product.gif
/2_new_files/your_admin_folder/includes/languages/english/modules/plugin/eo.php
/2_new_files/your_admin_folder/includes/languages/english/modules/plugin/plugin.php
/3_install/your_admin_folder/includes/auto_loaders/config.eo_onetime.php
/3_install/your_admin_folder/includes/init_includes/init_eo_install.php
/4_optional_items/1_onetime_discount/1_new_files/includes/languages/english/modules/order_total/ot_onetime_discount.php/includes/languages/english/modules/order_total/ot_onetime_discount.php
/4_optional_items/1_onetime_discount/1_new_files/includes/modules/order_total/ot_onetime_discount.php/includes/modules/order_total/ot_onetime_discount.php
/4_optional_items/1_onetime_discount/1_new_files/includes/languages/english/modules/order_total/ot_misc_cost.php/includes/languages/english/modules/order_total/ot_misc_cost.php
/4_optional_items/1_onetime_discount/1_new_files/includes/modules/order_total/ot_misc_cost.php/includes/modules/order_total/ot_misc_cost.php

Part of the simplification of the EO installation process is to lessen the core-file changes required. Zen Cart 1.5.5a has been updated to include additional notifiers within the admin's Customers->Orders processing and Zen Cart 1.5.6 (and later) expands on that update. EO now makes use of those notifications to add its buttons and icons to that tool.

The possibility does exist, however, that these required notifiers didn't get included when a store's Zen Cart installation was upgraded from a prior version. The following table lists the notifiers that allow EO to perform its processing.

Module Name Notifier "Key" Comments
/YOUR_ADMIN/orders.php NOTIFY_ADMIN_ORDERS_MENU_BUTTONS Built-in, issued during the orders-listing display, after creating the upper button-group for the selected order in the sidebar.
/YOUR_ADMIN/orders.php NOTIFY_ADMIN_ORDERS_MENU_BUTTONS_END Built-in, issued during the orders-listing display, after creating the lower button-group for the selected order in the sidebar.
/YOUR_ADMIN/orders.php NOTIFY_ADMIN_ORDERS_SHOW_ORDER_DIFFERENCE Added, issued during the orders-listing display, enabling additional icons to be associated with each order's line-item when creating the bottom button-group. This notifier is based on the like-named one in the Zen Cart 1.5.6+ repository.
/YOUR_ADMIN/orders.php NOTIFY_ADMIN_ORDERS_EDIT_BUTTONS Added, issued during an order's detailed view when creating the bottom button-group. This notifier is based on the like-named one in the Zen Cart 1.5.6+ repository.
/includes/modules/order_total/ot_shipping.php NOTIFY_OT_SHIPPING_TAX_CALCS Issued during an order's "order-totals" processing, allowing the order's shipping tax-rate and tax-description to be overridden. See this Zen Cart commit for zc156 for details. If your store runs on a zc155 variant, you can safely copy the entire zc156 module for use while you plan your store's zc156 upgrade!

The base Zen Cart admin version of the zen_add_tax function, present in /YOUR_ADMIN/includes/functions/general.php, currently pre-rounds its returned result … unlike the storefront version. Starting with EO v4.4.0, this condition must be corrected before you can use Edit Orders; you'll see the following message displayed in your admin's header if the condition exists.

EO Message

To correct the issue, you'll need to edit that function, changing:

/**
 * Add tax to a products price
 */
  function zen_add_tax($price, $tax) {
    global $currencies;

    if (DISPLAY_PRICE_WITH_TAX_ADMIN == 'true') {
      return zen_round($price, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']) + zen_calculate_tax($price, $tax);
    } else {
      return zen_round($price, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);
    }
  }
              

… to …

/**
 * Add tax to a products price
 */
  function zen_add_tax($price, $tax) {
    global $currencies;

    if (DISPLAY_PRICE_WITH_TAX_ADMIN == 'true') {
//-bof-edit_orders-lat9: Don't pre-round values, aligning with storefront
//      return zen_round($price, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']) + zen_calculate_tax($price, $tax);
      return $price + zen_calculate_tax($price, $tax);
    } else {
//      return zen_round($price, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);
      return $price;
    }
//-eof-edit_orders-lat9
  }
              

Edit Orders is easy to use; the interface looks similar to the Customers->Orders processing that is built into Zen Cart. Once the plugin is installed, navigate to Customers->Orders and click the "edit" button to view the editable details of the order.

Starting with v4.3.0 of EO, a checkbox input ("Reset totals prior to update?") appears next to the upper update button. Its default value is controlled by Configuration->Edit Orders->Reset Totals on Update — Default. If an order includes order-total modules (like Group Pricing) that affect both the order's total and tax values, you might need to tick that box to have EO correctly calculate any updated order.

Note: We do not recommend clicking "edit" on completed orders. When you edit an order, all order-totals are recalculated including tax, sub-total and total. Editing a completed order may result in undesired changes!

Edit Order customer and address

Once you've opened an order for editing, you can edit the customer, billing and/or shipping addresses as needed:

  1. You must enter a valid country name (and state) registered in the store's Zen Cart database. Failure to do so may result in incorrect calculation of taxes and order totals, warnings in the Zen Cart debug logs or potentially more serious errors resulting in the display of a "blank page" or the inability to correctly load or edit the order.
  2. Edit the phone number associated with the order as needed.
  3. Edit the payment method as needed. If you edit the "CC number" associated with the order, EO will sanitize that value in the database, removing portions of the value for PCI compliance.
  4. To save the changes, click the "update" button.
Edit Order add product

To add a product to the order, start by clicking the "Add Products" button near the center of the page and

  1. Narrow down the list of products by either selecting a category from the list or entering a search term and pressing the "enter" key on your keyboard.
  2. Choose a product from the list.
  3. Choose any product options / attributes as needed.
  4. Select quantity and pricing options.
    1. Enter the desired quantity. This field will be subject to the product's min / max configured settings. Inventory numbers will be adjusted for the selected product in the database.
    2. Choose whether to use any configured store specials or sales price for the product or to only use the full product price.

Once you've made your selections, click the "Add now" button.

Edit Order update product

You can update (edit) each product's quantity, name, model, price, one-time charges, tax-rate and product options. When you're finished, click the "update" button to save your changes.

Edit Order change order totals

Price calculations for order-totals are processed by the order-total modules directly and not Edit Orders. This helps prevent math errors and ensure consistency. Not all 3rd party order-total modules were written with the capability to be loaded and run against an order from the Zen Cart admin interface.

Many of the common order-total modules are automatically calculated for the order based upon store settings and information present in the order. Automatically calculated order-totals such as ot_tax, ot_loworderfee, ot_subtotal and ot_total cannot be edited or removed from an order.

Add an Order-Total

To add an order-total to the active order's calculations:

  1. Select the order-total module to be added; if you select shipping, you need to also choose a specific shipping-module name.
  2. Enter the textual name that is displayed to the customer (and admins) when viewing the to-be-updated order — note that some order-total modules will automatically change this name!
  3. Add the desired order-total cost. Note that while Gift Certificates and Vouchers costs can be entered as either a positive or negative value, the value is displayed as a negative number after the order is updated.
  4. Click the "update" button to save the changes.

Remove an Order-Total

To remove an order-total from the active order's calculations:

  1. Clear the order-total "name" and cost fields.
  2. Click the "update" button to save the changes.

Update an Order-Total

To update an order-total for the active order's calculations:

  1. If you are editing the Shipping order-total (ot_shipping), you can change the shipping-module by selecting the desired module from the drop-down list.
  2. Update the order-total's name as displayed to the customer, noting that some order-total modules automatically update the name.
  3. Update the order-total's cost to reflect the desired amount.
  4. Click the "update" button to save the changes.

Note: Prices are displayed with or without tax based upon the storefront settings not the admin settings, in an attempt to emulate the environment in which the order-totals are calculated. Most of the order-total modules are designed to run from the storefront only. Refer to the Zen Cart configuration setting DISPLAY_PRICE_WITH_TAX.

To change an order's status and/or add a comment to the order, follow the procedure you use within the built-in Customers->Orders processing and click the "update" button to apply the changes to the order.

The following is a list of some commonly installed 3rd party Zen Cart modules (plugins) known to be compatible with Edit Orders. The list is mainly confined to 3rd party plugins which also affect customer orders or placing customer orders. Please refer to the appropriate module for further notes and instructions (if any).

Order-total modules are used to change the total cost of an order. Edit Orders uses the same order-total modules as the storefront checkout process. Most of the order-total modules which ship with Zen Cart have been validated and work as expected (ot_coupon, ot_gv, ot_loworderfee, ot_shipping, ot_subtotal, ot_tax and ot_total). Both ot_subtotal and ot_total must be enabled for Edit Orders to function correctly.

If your store includes products with attributes and your want EO to display your products' attributes in the same order as the storefront operation, you'll need to make a change to /includes/modules/attributes.php. See this Zen Cart posting for additional information.

  1. If you don't already have a template-override version of the file, make one by copying /includes/modules/attributes.php to /includes/modules/YOUR_TEMPLATE/attributes.php.
  2. Locate the following section (towards the top of the file):
                        if (PRODUCTS_OPTIONS_SORT_ORDER=='0') {
                          $options_order_by= ' order by LPAD(popt.products_options_sort_order,11,"0")';
                        } else {
                          $options_order_by= ' order by popt.products_options_name';
                        }
                    
  3. Change the line indicated:
                        if (PRODUCTS_OPTIONS_SORT_ORDER=='0') {
                          $options_order_by= ' order by LPAD(popt.products_options_sort_order,11,"0"), popt.products_options_name';
                        } else {
                          $options_order_by= ' order by popt.products_options_name';
                        }
                    

Edit Orders has been validated with Local Sales Tax v2.3.5 or newer installed; previous versions are not supported. To integrate the two plugins, you'll need to copy the file /includes/functions/extra_functions/functions_local_sales_taxes.php to /YOUR_ADMIN/includes/functions/extra_functions/functions_local_sales_taxes.php for that order-total module to "find" the functions it needs!

Note: The tax rate shown next to individual products reflects only the Zen Cart configured tax rate. It does not include any tax rates defined by Local Sales Tax. The sales tax rate cannot be adjusted by Edit Orders for the Local Sales Taxes module.

Because Edit Orders loads the same order-total modules as the storefront checkout process, all enabled modules must be able to be loaded and processed from the store's Zen Cart admin-console. Because Zen Cart traditionally does not use those modules during admin-level processing, many 3rd-party order-total modules were designed without the authors taking this into consideration.

The most common symptom caused by a problematic order-total module (when editing an order) is the presentation of a "blank" page when adding a product to (or updating) the order. In most cases taking a look at the generated debug log provides valuable insight as to how to correct the underlying issue. Another option is to disable all add-on order-total modules and then enable them one-by-one to determine which order-total module is causing the blank page.

Here are some common causes of issues with 3rd-party order-total modules and possible corrective actions:

  1. The order-total's installation includes additional storefront functions.
    • Copy the order-total's function file(s) to your store's /YOUR_ADMIN/includes/functions/extra_functions directory.
  2. The order-total inspects the values in $_SESSION['cart'] instead of those present in the $order object to determine the associated value to display.
    • Update the module to check and use the $order object.

You can view the details of these changes on the plugin's GitHub repository.

  • v4.5.0, 2019-12-02 (lat9)
    • BUGFIX: Correct PHP notices when an order has no 'tax_groups'.
    • BUGFIX: Selected attribute-value not displayed on order's initial display.
    • BUGFIX: Incorrect constant name used for Ty Package Tracker link.
    • BUGFIX: Correct 'Add Product' PHP notices, missing numeric fields' override variables.
    • CHANGE: Enable a store to configure the display-order for the order's addresses.
    • BUGFIX: Incorrect detection of additional order-status-history fields.
    • The following files were changed or added:
      1. /YOUR_ADMIN/edit_orders.php
      2. /YOUR_ADMIN/includes/classes/editOrders.php
      3. /YOUR_ADMIN/includes/init_includes/init_eo_config.php
      4. /YOUR_ADMIN/includes/modules/edit_orders/eo_addresses_cbs.php
      5. /YOUR_ADMIN/includes/modules/edit_orders/eo_addresses_csb.php
  • v4.4.3, 2019-10-05 (lat9)
    • BUGFIX: Correct variable-name identifying product to use for attribute-pricing.
    • BUGFIX: Correct PHP notices when updating an order's totals.
    • BUGFIX: Correct empty order rendered if observer disallows the order's update.
    • BUGFIX: Correct PHP notice, adding the 'Edit' button to the Customers::Orders display.
    • CHANGE: zc157 future-proofing; change to zen_draw_input_field.
    • CHANGE: zc157 future-proofing; Multi-lingual countries.
    • BUGFIX: Correct PHP notice during 'EDIT_ORDERS_DISPLAY_ONLY_TOTALS' notification processing.
    • CHANGE: zc156+, restore the order's shipping-address information when the order's shipping-method is 'storepickup'.
    • BUGFIX: Correct new order-totals can no longer be added.
    • CHANGE: Sort orders-status values by their sort_order, if the field exists in the database.
    • CHANGE: Additional notifications provided to enable customization.
    • CHANGE: Enable a store to override EO's use of numeric fields; see this GitHub issue for details.
    • BUGFIX: Provide mock-cart 'total' and 'weight' values (interoperation).
    • BUGFIX: Correct MySQL error if a store doesn't use ot_shipping
    • BUGFIX: Document change required if a store uses a cron-job for the currency-cron.
    • The following files were changed:
      1. /YOUR_ADMIN/edit_orders.php
      2. /YOUR_ADMIN/includes/classes/editOrders.php
      3. /YOUR_ADMIN/includes/classes/mock_cart.php
      4. /YOUR_ADMIN/includes/classes/observers/EditOrdersAdminObserver.php
      5. /YOUR_ADMIN/includes/functions/extra_functions/edit_orders_functions.php
      6. /YOUR_ADMIN/includes/init_includes/init_eo_config.php
  • v4.4.2, 2019-07-27 (lat9)
    • BUGFIX: Correctly enable non-integer tax rates for the gross/net handling for stores that display prices with tax.
    • BUGFIX: Properly center the top order-navigation links and form.
    • The following files were changed:
      1. /YOUR_ADMIN/edit_orders.php
      2. /YOUR_ADMIN/includes/init_includes/init_eo_config.php
  • v4.4.1, 2019-07-09 (lat9)
    • BUGFIX: Correctly manage products' quantities on order's updates.
    • The following files were changed:
      1. /YOUR_ADMIN/includes/functions/extra_functions/edit_orders_functions.php
      2. /YOUR_ADMIN/includes/init_includes/init_eo_config.php
  • v4.4.0, 2019-06-01 (lat9)
    • CHANGE: Additional notifications for external tax-handlers.
    • BUGFIX: Remove doubly-defined constant.
    • BUGFIX: Correct various PHP warnings.
    • BUGFIX: Remove multiple trailing colons (':') from the shipping-method's title on an order-update.
    • BUGFIX: Correct 'ot_misc_cost' taxable issues.
    • CHANGE: Update array-formatting for eo-logs.
    • BUGFIX: Correct rounding errors.
    • CHANGE: Provide net/gross jQuery calculations for stores that display prices with tax.
    • CHANGE: Provide styled buttons/icons for Zen Cart 1.5.6 and later.
    • CHANGE: Enable integration with Attribute Image Swapper.
    • CHANGE: All EO cart-related actions are now provided by its "mock" cart class.
    • CHANGE: Enable automatic pricing calculations, either with or without specials' pricing.
    • BUGFIX: Apply existing coupon when adding a product to the order.
    • BUGFIX: Record a coupon's "coupon_code" in the order when a coupon is added via EO's processing.
    • CHANGE: Additional notification issued for customized, display-only order totals.
    • CHANGE: Add configuration settings to control the display of the status-history and comments section.
    • CHANGE: Additional notification issued to enable additional javascript to be included.
    • CHANGE: Additional notification issued to enable additional columns in an order's status-history table.
    • CHANGE: Display an Updated By column in the status-history table, if that field is present in the store's database.
    • BUGFIX: ot_onetime_discount causes PHP warning on initial display in admin's Modules->Order Total.
    • The following files were changed:
      1. /includes/languages/english/modules/order_total/ot_misc_cost.php
      2. /includes/modules/order_total/ot_misc_cost.php
      3. /includes/modules/order_total/ot_onetime_discount.php
      4. /YOUR_ADMIN/edit_orders.php
      5. /YOUR_ADMIN/includes/edit_orders.css
      6. /YOUR_ADMIN/includes/auto_loaders/config.eo.php
      7. /YOUR_ADMIN/includes/classes/attributes.php
      8. /YOUR_ADMIN/includes/classes/editOrders.php
      9. /YOUR_ADMIN/includes/classes/mock_cart.php
      10. /YOUR_ADMIN/includes/classes/observers/EditOrdersAdminObserver.php
      11. /YOUR_ADMIN/includes/functions/extra_functions/edit_orders_functions.php
      12. /YOUR_ADMIN/includes/init_includes/init_eo_config.php
      13. /YOUR_ADMIN/includes/languages/english/edit_orders.php
      14. /YOUR_ADMIN/includes/languages/english/extra_definitions/edit_orders.php
    • The following changes are made to the database:
      1. Adds the column shipping_tax_rate to the orders table.
      2. Removes the configuration setting 'Use a mock shopping cart?'.
      3. Updates the Product Price Calculations configuration settings, enabling an additional calculation method.
      4. Adds the Status-history Display Order and Status-update: Customer Notification Default configuration settings.
  • v4.3.5, 2018-10-31 (lat9)
    • BUGFIX: New configuration settings not included on initial install.
    • BUGFIX/CHANGE: Ensure that order totals' sort_order is a numeric value.
    • The following files were changed:
      1. /YOUR_ADMIN/includes/functions/extra_functions/edit_orders_functions.php
      2. /YOUR_ADMIN/includes/init_includes/init_eo_config.php
  • v4.3.4, 2018-04-08 (lat9)
    • BUGFIX/CHANGE: Re-align /YOUR_ADMIN/orders.php notifiers with v1.5.6 and later.
    • BUGFIX: Change to shipping-method doesn't "stick".
    • CHANGE: Additional notifiers for stock-decrement and order-total processing.
    • BUGFIX: Correct interaction with various order-total plugins, especially with tax calculations.
    • BUGFIX: Correct PHP 7.1+ warning about "A non-numeric value".
    • CHANGE: Modify ot_onetime_discount to enable the entry of both additions to and deductions from an order's total. You'll need to remove and re-install the order-total module prior to use.
    • BUGFIX/CHANGE: Entered product prices no longer honored after v4.3.3 update; additional configuration settings added.
    • The following files were changed:
      1. /includes/modules/order_total/ot_onetime_discount.php
      2. /YOUR_ADMIN/edit_orders.php
      3. /YOUR_ADMIN/orders.php Single line (#928) changed, modifying notification id from NOTIFY_ADMIN_ORDERS_LISTING_ROW to NOTIFY_ADMIN_ORDERS_SHOW_ORDER_DIFFERENCE.
      4. /YOUR_ADMIN/includes/classes/observers/EditOrdersAdminObserver.php
      5. /YOUR_ADMIN/includes/functions/extra_functions/edit_orders_functions.php
      6. /YOUR_ADMIN/includes/init_includes/init_eo_config.php
      7. /YOUR_ADMIN/includes/languages/english/edit_orders.php
  • v4.3.3, 2018-03-09 (lat9)
    • BUGFIX: Product price not updated when attributes are changed.
    • BUGFIX: Incorporate zc156+ notification.
    • CHANGE: Display warning if Configuration->Stock->Allow Checkout is set to 'false' and insufficient stock is available.
    • The following files were changed:
      1. /YOUR_ADMIN/includes/edit_orders.php
      2. /YOUR_ADMIN/includes/classes/observers/EditOrdersAdminObserver.php
      3. /YOUR_ADMIN/includes/functions/extra_functions/edit_orders_functions.php
      4. /YOUR_ADMIN/includes/init_includes/init_eo_config.php
      5. /YOUR_ADMIN/includes/languages/english/edit_orders.php
  • v4.3.2, 2018-03-07 (lat9)
    • BUGFIX: Attributes are lost from products when an order is updated.
    • BUGFIX: Load admin extra functions only for edit_orders use; corrects unwanted interaction with Admin New Order.
    • CHANGE: Log-file formatting updates.
    • The following files were changed:
      1. /YOUR_ADMIN/includes/edit_orders.php
      2. /YOUR_ADMIN/includes/classes/editOrders.php
      3. /YOUR_ADMIN/includes/functions/extra_functions/edit_orders_functions.php
      4. /YOUR_ADMIN/includes/init_includes/init_eo_config.php
  • v4.3.1, 2018-01-16 (lat9)
    • BUGFIX: Correct shipping-tax calculations when shipping is the only taxed portion of the order.
    • BUGFIX: Correct shipping-tax calculations when a store "Displays prices with tax".
    • BUGFIX: Correct unwanted multiple messages on initial plugin installation.
    • BUGFIX: Allow "special characters" in updated address fields.
    • The following files were changed:
      1. /YOUR_ADMIN/edit_orders.php
      2. /YOUR_ADMIN/includes/classes/editOrders.php
      3. /YOUR_ADMIN/includes/extra_datafiles/eo_sanitization.php
      4. /YOUR_ADMIN/includes/functions/extra_functions/edit_orders_functions.php
      5. /YOUR_ADMIN/includes/init_includes/init_eo_config.php
  • v4.3.0, 2017-10-01 (lat9)
    • BUGFIX: Include "products_ordered" in columns retrieved from the "products" table.
    • CHANGE: Add notifiers to enable additional address fields to be inserted.
    • BUGFIX: Use "correct" variable in the mock cart's get_products function.
    • BUGFIX: Correct PHP "notify" logs for missing/undefined variables.
    • BUGFIX: Correct PHP "notify" logs when an order-total doesn't include a TAX_CLASS.
    • BUGFIX: Missing notifiers were not being reported.
    • BUGFIX: Order-total recalculation incorrect when some order-totals (e.g. Group Pricing) are included.
    • The following files were changed:
      1. /includes/classes/vinos/common/NotifierCheck.php
      2. /YOUR_ADMIN/edit_orders.php
      3. /YOUR_ADMIN/includes/classes/editOrders.php
      4. /YOUR_ADMIN/includes/classes/mock_cart.php
      5. /YOUR_ADMIN/includes/functions/extra_functions/edit_orders_functions.php
      6. /YOUR_ADMIN/includes/languages/english/edit_orders.php
      7. /YOUR_ADMIN/includes/languages/english/extra_definitions/edit_orders.php
      8. /YOUR_ADMIN/includes/init_includes/init_eo_config.php
  • v4.2.3, 2017-04-23 (lat9)
    • BUGFIX: Correct attribute-sorting issue.
    • The following files were changed:
      1. /YOUR_ADMIN/includes/classes/attributes.php
      2. /YOUR_ADMIN/includes/init_includes/init_eo_config.php
  • v4.2.2, 2017-03-20 (lat9)
    • BUGFIX: Correct PHP parse error introduced in v4.2.1.
    • The following files were changed:
      1. /YOUR_ADMIN/orders.php
      2. /YOUR_ADMIN/includes/init_includes/init_eo_config.php
  • v4.2.1, 2017-03-19 (lat9)
    • BUGFIX: Incorrect variable used in Packing Slip and Invoice links on an order's details page.
    • The following files were changed:
      1. /YOUR_ADMIN/orders.php
      2. /YOUR_ADMIN/includes/init_includes/init_eo_config.php
  • v4.2.0, 2017-03-01 (lat9)
    • CHANGE: Require Zen Cart 1.5.5a or later.
    • CHANGE: Remove integration with Ty Package Tracker from \YOUR_ADMIN\orders.php.
    • CHANGE: Restructure plugin installation.
    • The following files were changed, added or removed:
      1. /includes/auto_loaders/init_vinos_autoload.php
      2. /includes/classes/order_total.php1
      3. /includes/classes/shipping.php1
      4. /includes/classes/VinosAutoload.php
      5. /includes/classes/vinos/common/NotifierCheck.php
      6. /includes/init_includes/init_vinos_autoload.php
      7. /YOUR_ADMIN/orders.php
      8. /YOUR_ADMIN/images/icon_edit.gif1
      9. /YOUR_ADMIN/includes/auto_loaders/config.eo.php
      10. /YOUR_ADMIN/includes/auto_loaders/config.zc154_compatibility.php
      11. /YOUR_ADMIN/includes/classes/eo_plugin.php
      12. /YOUR_ADMIN/includes/classes/plugin.php2
      13. /YOUR_ADMIN/includes/classes/observers/EditOrdersAdminObserver.php
      14. /YOUR_ADMIN/includes/extra_configures/edit_orders.php
      15. /YOUR_ADMIN/includes/extra_datafiles/edit_orders_defines.php
      16. /YOUR_ADMIN/includes/init_includes/init_eo_config.php
      17. /YOUR_ADMIN/includes/init_includes/init_vinos_common_admin.php
      18. /YOUR_ADMIN/includes/init_includes/init_zc154_compatibility.php
      19. /YOUR_ADMIN/includes/languages/english/orders.php1
      20. /YOUR_ADMIN/includes/languages/english/extra_definitions/edit_orders.php
      21. /YOUR_ADMIN/includes/languages/english/plugins/eo.php
      22. /YOUR_ADMIN/includes/languages/english/plugins/plugin.php2
      1Identifies that the file was removed from this plugin's distribution only; use the version associated with your Zen Cart distribution.
      2Other plugins, notably Ultimate SEO URLs, that make use of a module using the same name but different contents; make sure that the module isn't required by others prior to removing.
  • v4.1.7, 2016-10-24 (lat9)
    • BUGFIX: Modify order.php to include the "value" for each order-total in the order.
    • BUGFIX: Correct interaction with "ot_cod_fee".
    • BUGFIX: Correctly handle taxable order-totals.
    • BUGFIX: Correct currency-related rounding issues.
  • v4.1.6, 2016-08-06 (lat9)
    • CHANGE: Convert tabs to 4 spaces in some of the files.
    • CHANGE: Re-factor debug-output; the EO debug output file is now generated on an order-by-order basis.
    • BUGFIX: Don't display the "Missing shipping information" message is the order contains only virtual products.
    • BUGFIX: Tax not added if the order didn't start with taxes and/or if a product is added to the order.
    • BUGFIX: Missing echo in admin's orders.php merge; the bottom "Edit Order" button was rendered useless.
  • v4.1.5, 2016-05-19 (A. Ballanger and lat9)
    • BUGFIX: Correct "Unknown column 'p.products_quantity' in 'field list".
    • BUGFIX: Corrections for coupons with category / product restrictions.
    • CHANGE: Account for order-total modules that have been removed.
    • CHANGE: Mimic storefront sort-order for attributes' display.
    • BUGFIX: Correct incorrect tax-calculations after editing an order.
    • BUGFIX: Correct multi-line comments display with \r\n.
    • CHANGE: Include a "Miscellaneous Cost" order-total that's Edit Orders specific.
    • BUGFIX: Correct interaction with stores that use the "Split Tax Lines" configuration.
    • CHANGE: Remove reliance on the built-in currency initialization scripts.
    • CHANGE: Add support for the "admin sanitization" introduced in Zen Cart 1.5.5.
  • v4.1.4, 2015-01-27 (A. Ballanger)
    • Updated the installation, upgrade, and removal process to use "Plugin Manager" 0.5rc2 core files.
  • v4.1.3, 2014-01-06 (A. Ballanger and lat9)
    • Updated the installation, upgrade, and removal process to use a newer version of "Plugin Manager" core files.
    • Cleaned up the english language files. Obsolete entries were removed and some new entries added.
    • Removed the optional language files as they no longer contain all the neccessary defined constants.
    • Added various changes to support Zen Cart 1.5.2 (including copying additional functions from the catalog side).
    • Added a mock "shopping cart" class which reads product data from the current order. This should help with Order Total modules which only look at the shopping cart ($_SESSION['cart']) and ignore the order ($order).
    • Added optional "debug" file logging. This should only be used for problem solving as it may adversely affect performance.
    • When a product is loaded from the database, additional fields are populated to match Zen Cart 1.5.2 handling.
    • Added handling for updating an order containing a deleted product. It is strongly recommended to not delete products until after all editing of orders containing the product are completed.
      • The tax description is neccessary and will be generated using TEXT_UNKNOWN_TAX_RATE.
      • Tax class details will not be present or generated.
      • Attribute information may not fully populate or may be lost.
    • One can now place the coupon code by itself in the "title" for "ot_coupon"
    • Included an optional "Onetime Discount" order total module.
    • Changes to the way order status / order history is handled:
      • If the status is changed it will be recorded (with or without comment).
      • The comment (if any) will be added to the order history (previously only added if the status changed).
      • The tracking number(s) (if any) will be added to the order history.
      • If the option to notify the customer is selected the customer will be sent an email.
      • When the option to append comments is selected the following will be included in the email:
        • The comment (if any) along with EMAIL_TEXT_COMMENTS_UPDATE.
        • The tracking number(s) along with EMAIL_TEXT_COMMENTS_TRACKING_UPDATE.
    • Added the option to "strip" HTML and PHP tags from the list of enabled shipping modules.
    • Added warning messages if ot_total or ot_subtotal are disabled.
    • Added a check (and repair) for missing core configuration directives related to attributes.
    • Moved initial checks and warnings performed by the edit orders admin page to a function.
    • Fixed a bug which did not allow products to use "partial" quantities (fractions).
    • Fixed a bug causing an obsolete file to not be removed upon install / upgrade.
    • File Upload attributes will now be passed along when updating the product. Removing a File Upload attribute is not supported.
    • Updated the code removing products from an order. These now use the Zen Cart "stock" configuration options to increment / decrement stock quantities.
  • v4.1.2, 2017-07-28 (A. Ballanger)
    • Changed the "local_sales_tax" line to no longer be editable as the value is automatically generated based upon the order.
    • When adding a coupon code, if the code is not valid the order total will not be added (and if invalid and present will be removed).
    • Added a check when adding checkboxes to avoid generating a warning when no checkbox in the option group was selected.
    • When removing a product from the order, other items in the order are now correctly processed and updated (if changed).
    • Fixed a bug caused when adjusting the quantity of an item in an order (introducted in Edit Orders 4.1.1).
    • Fixed a bug when adding a product to an order w/ a text attribute containing a double quote (").
    • Functions handling form inputs now utilize zen_db_output (added in Zen Cart 1.5.1) or fall back to htmlspecialchars.
    • One Time Charges for a product are now reflected in the Total Price column for the product (were already added to the subtotal).
  • v4.1.1, 2013-07-13 (A. Ballanger)
    • Updated tax calculations to Zen Cart 1.5.1 based code.
    • Fixed a tax calculation bug when all products were removed from an order.
    • Fixed the code handling product attribute updates to be more accurate.
    • Fixed a bug which caused the subtotal to always be zero.
    • Fixed a bug with the automatic calculation of onetime charges based on attributes (when adding a product).
    • When the order is loaded address information more closely matches the information found during checkout.
      • If we can determine the country by id, name, or iso code:
        • The "country" field will contain the Zen Cart country array.
        • The "zone_id" field will be populated based upon country and state.
      • Otherwise, the "country field will contain the country name. This allows one to see / update the country (to one found in the Zen Cart country database).
    • The country listed for addresses will now be displayed as a dropdown if the country exists in the Zen Cart database. Otherwise it will be displayed as text.
    • Copied the catalog tax function "zen_get_tax_rate_from_desc()" from Zen Cart 1.5.1 to support additional order total modules.
    • Copied the catalog function "zen_get_country_list" from Zen Cart 1.5.1 to support country dropdowns in the addresses.
    • Zen Cart functions copied from the "catalog" side are only included if not already present.
    • Disabled manual editing of the "Low Order Fee" order total module. This is handled automatically.
    • If no remaining order total modules are available to add to an order, the order total entry fields will not be shown.
    • Ty Tracker will add a tracking number to the sent email when:
      1. The order is updated and notify customer is selected.
      2. Ty Tracker is installed and enabled.
      3. A Tracking Code is present for the "shipper".
      4. The "shipper" is enabled in Ty Tracker.
    • Included the "plugin" class and associated files.
      • The class and files are not part of "Edit Orders".
      • Provides for simplification of the installation / upgrade process.
      • Provides for simplification of the removal process.
      • Does some extra checks against Zen Cart's configure.php files.
    • Created new install, upgrade, and removal processes.
      • Makes use of the "plugin" class and associated files
      • On upgrade attempts to make needed modifications to any existing orders.php from "Super Orders" or "Admin New Order"
    • Cleaned up comments in "orders.php" to be more friendly.
    • Links in "orders.php" to edit will no longer appear if Edit Orders is not installed.
    • Moved 'BOX_CONFIGURATION_EDIT_ORDERS' into a language file (used to display the configuration menu item).
    • Updated readme (collaboration of Zen Cart forum members).
  • v4.1, 2017-04-12 (A. Ballanger and C. Jones)
    • Reduced duplicate code for Ty Package Tracker support.
    • Complete rewrite of the code handling products and attributes.
      • Utilizes Zen Cart functions and classes where possible.
      • Added many new functions to provide better support products and attributes.
      • Added a class used to abstract access to product attributes.
      • Used when displaying, updating, and adding products (including attributes).
    • Added updated versions of some Zen Cart core classes to allow them to work correctly from the admin side of Zen Cart.
      • admin/init_includes/init_currencies.php to load the currencies class.
      • includes/classes/order_total.php to load the correct language files.
      • includes/classes/shipping.php to load the correct language files.
    • When adding a product:
      • You can now search by product id, name, description, and model.
      • Step 2 now shows both the product name and model.
      • The built-in Zen Cart functions are called in a similar manner as adding a product to your shopping cart. This ensures the order totals can be automatically updated.
      • You can disable the use of "specials / sales prices" still. This is not recommended.
      • The store settings for handling attributes (including showing / hiding) are utilized.
    • When updating a product: product information is pulled from the database, then requested changes (such as name and price) are merged. This ensures the correct product information is always present in the order.
    • Updated to utilize the order_totals class and modules
      • Order Total modules are loaded when adding or updating a product.
      • Ensures proper calculation of subtotal and total.
      • Tax calculation now is done automatically using the store settings (same as during a customer checkout).
      • Order Total Lines are now added by selecting the desired module from a dropdown.
      • The Order Total dropdown contains a list of installed order totals not already present in the order.
      • Added support for specifying and changing the shipping module when a shipping line is used.
      • Removed field for changing the shipping tax. This is automatically calculated by includes/modules/order_total/ot_shipping.php.
    • Copied (and modified for use in the admin side of Zen Cart) a handful of the catalog tax functions to admin/functions/extra_functions/edit_orders_functions.php
    • Updated the installation script to add additional failure messages and not report success if a step fails.
    • Fixed the order status dropdown to correctly select order status. This avoids the status being accidentally changed if the status is not "Pending (1)".
    • Moved the "edit" button in the order menu over so the "details" button is more likely to be clicked by someone quickly looking at an order. This should hopefully lower the number of "accidentally" edited orders.
    • Added special handling to support the ot_loworderfee module.
    • Added some "dummy" files for those upgrading from an older version.
    • Minor updates to the readme for version 4.1.
  • Older, pre-v4.1 changes can be viewed here.