Creating complex discounts in Zen Cart

As ridiculously overengineered powerful as my software may seem, some shopowners can’t help but take it up a notch by using complex PHP within the setup() functions I provide.  Here are some examples of complex Zen Cart discount configurations you can do by adding more logic to the setup() functions of Zen Cart Better Together, Combination Discounts and Table Discounts.

Renaming Zen Cart files for backup

This is a common problem I see in failed mod installs: incorrectly renaming files you wish to keep as backups.   Zen Cart automatically loads all files ending with the extension “.php” in certain directories (such as includes/functions/extra_functions and includes/modules/order_totals), so you must name your backup files in a way such that they do not end with the extension “.php”.

For example: suppose you want to save a backup copy of the file ot_coupon.php

Good names:

ot_coupon.php.5Oct10
ot_coupon.php.orig
ot_coupon.php.old

Bad Names

5Oct10.ot_coupon.php
orig-ot_coupon.php
old.ot_coupon.php

 

osCommerce Table Discounts

Table Discounts for osCommerce is ready! All you osCommerce users who want to do Quantity Discounting on a per Category, Product or Manufacturer basis, with different schedules for each, take a look! Oh, and yes, of course Discount Preview for osCommerce works with Table Discounts, for osCommerce 2.2 and 2.3.1.  (If you’re a Zen Cart user,  please look at the original Table Discounts for Zen Cart.)