Sales Report and my discounting mods

NOTE: This post was created several years ago; a more complete list of discounts and associated classes is provided here.

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 the Zen Cart Sales Report mod, please be aware of the following issue.

Running Sales Report against an order with one of these discounts will cause the totals not to add up correctly.

The fix is to modify admin/includes/classes/sales_report.php  as follows:  search for

          elseif ($class == "ot_coupon" || $class == "ot_group_pricing" || $class == "ot_better_together") {

and add in the classes you are using.

For Quantity Discounts, this would be

$class == "ot_coupon" || $class == "ot_group_pricing" || $class == "ot_better_together" || $class == "ot_quantity_discount"

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”

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

elseif ($class == "ot_coupon" || $class == "ot_group_pricing" ||
                 $class == "ot_better_together" ||
                 $class == "ot_big_chooser" ||
                 $class == "ot_bigspender_discount" ||
                 $class == "ot_combination_discounts" ||
                 $class == "ot_frequency_discount" ||
                 $class == "ot_quantity_discount" ||
                 $class == "ot_newsletter_discount" ||
                 $class == "ot_military_discount"
) {