Zen Cart Edit Orders/Super Orders and my discounting mods

If you are using any of my discounting software (Better Together, Combination Discounts, Big Spender, Big Chooser, Quantity Discounts, Frequency Discounts, Military Discounts, Newsletter Discounts) along with Zen Cart Edit Orders or Super Orders please be aware of the following issue.

*** Update 08/20/2012 – updated for Table Discounts, Manufacturer Discounts.

Running Edit Orders or Super Edit against an order with one of these discounts will improperly change the minus sign in the discount amount to a plus sign.  So a Better Together discount of $15.00 will become a $15.00 surcharge.

The root cause of this bug is that both of these mods, when updating an order, enumerate through a fixed list of classes to see if the order total in question a known native discount (coupons or group discounts), and otherwise, assumes it’s a surcharge.

The fix is to modify admin/edit_orders.php and admin/super_edit.php as follows:  search for

 $ot_class == "ot_coupon"

and add in the classes you are using.   For Better Together, this would be

$ot_class == "ot_coupon" || $ot_class == "ot_better_together"

For Better Together and Quantity Discounts, this would be

$ot_class == "ot_coupon" || $ot_class == "ot_better_together" || $ot_class == "ot_quantity_discount"

“if statements” containing this check occur several times (depending on version) in the two files; make sure you get them all.

A complete list of the classes I have created that require this fix is:

  • Better Together: “ot_better_together”
  • Big Chooser: “ot_big_chooser”
  • Big Spender: “ot_bigspender_discount”
  • Combination Discounts: “ot_combination_discounts”
  • Frequency Discounts: “ot_frequency_discount”
  • Quantity Discounts:  “ot_quantity_discount”
  • Newsletter Discounts: “ot_newsletter_discount”
  • Military Discount: “ot_military_discount”
  • Table Discounts: “ot_table_discounts”
  • Manufacturer Discount: “ot_manufacturer_discount”

If you want a complete if clause that handles all of these plus the built in discounts (including GV), it would look like this:

if ($ot_class == "ot_gv" || $ot_class == "ot_coupon" || $ot_class == "ot_group_pricing" ||
                 $ot_class == "ot_better_together" ||
                 $ot_class == "ot_big_chooser" ||
                 $ot_class == "ot_bigspender_discount" ||
                 $ot_class == "ot_combination_discounts" ||
                 $ot_class == "ot_frequency_discount" ||
                 $ot_class == "ot_quantity_discount" ||
                 $ot_class == "ot_newsletter_discount" ||
                 $ot_class == "ot_table_discounts" ||
                 $ot_class == "ot_manufacturer_discount" ||
                 $ot_class == "ot_military_discount"
) {