Zen Cart custom software development, Zen Cart modules, Zen Cart Expert eCommerce with Zen Cart!

Zen Cart Discount Chooser

Zen Cart Discount Chooser Mega Module

Discount Chooser Mega Module for Zen Cart (formerly Free Gift Chooser for Zen Cart) simplifies the process of creating discounts based on items in the cart. It's almost like Big Chooser with an Admin panel!

Extended Family also works with Discount Chooser as a "package builder". See package discounting and promotion for more details.

Background: See the Zen Cart Matrix-o-discounts for a perspective on Discount Chooser Mega Module.
A comparison to my other discounting modules is in the comparison section here.

Example Discounts: I have provided several examples of Zen Cart Discount Chooser discounts.

Relevance: Zen Cart™ 1.5.x
See interoperability for changes required for Edit Orders.

You must have JavaScript enabled in your browser.

Current Version: 2.7 (version history)

Support Thread: My commercial software is not supported on the Zen Cart forum. Please email me questions instead.

Cost: $60

Buy Now (Note: this low price covers software only for self-installation.)

Would you like to ask me questions before buying? I'm happy to help likely purchasers make the right decision. Please use my contact form.

Installed Cost: $200.00 (Professional installation by That Software Guy)

Installation Difficulty: Moderate

Installation Instructions: click here for installation instructions

Common Installation Issues: click here for installation issues

Tax Notes: Notes on tax handling

Buy: Buy Discount Chooser!
Pre-purchase questions? No problem! Just Please contact me with your question.

FAQ: click here for FAQ

Configuration: Configuration of Discount Chooser is done by the built-in admin panel. You may try the admin panel yourself using the "See it Live" instructions below.

Marketing Text: click here for marketing text

Video: You may watch this discount being created in Discount Chooser v1.0 Admin panel in this video:



(Note that this is an older version which didn't support multiple types of discounting; the 100% discount was implicit. This version also did not support editing.)

You can see how to create a discount, such as buy one get one half off, in this video: Creating Discounts in Zen Cart with Discount Chooser.

You can see how to use the deal id feature and editing in this video: Editing Discounts in Zen Cart with Discount Chooser.

Promotional Page: free from my website (you must buy Discount Chooser separately)

Add-Ons: Discount Chooser is an order total module, so the discount is not visible until the second page of checkout. If you want to see the discount on the shopping cart page (or sidebox), look at Discount Preview.




You can display your promotions on the shopping cart page and the checkout shipping page using Big Upsell.

You can display your promotions on the shopping cart page and the checkout shipping page using Big Upsell.

Discount Chooser is even more powerful when used in conjunction with Extended Family to build product pages. See package discounting and promotion for more details.

Incompatibilities: Discount Chooser does NOT have the limitation of 400 categories the way Better Together Admin does. So if you have a large number of categories (or categories with a large number of products), Discount Chooser is a better option for you.

This module specifically sets a specific limit of 12 on both the number of items required (conditions) and number of items discounted (free gifts); you cannot use an arbitrary number the way you can in Big Chooser. You can see the dropdowns that set these two values in the dropdown section here.

The condition categories and discount categories must be different in most cases; Discount Chooser is not well suited for BOGO type discounts.

Bugs: click here for bugs


Overview:

There are lots of discounting options in Zen Cart. No one module is perfect for everyone. A lot of people wanted more power than Combination Discounts had, but they didn't like the complexity and lack of an admin panel that came with Big Chooser. So I tried to meet them half way with Discount Chooser Mega Module.

So you're asking yourself, "What the heck is a Mega Module?" Easy. A Mega Module contains the catalog side code and an admin panel all in one. No more separate purchases, and no updating PHP code!

Discount Chooser Mega Module allows you to specify up to 12 conditions (required purchases) of products or categories, and up to 12 possible gifts or discounted items.

Discount Chooser Initial Screen

Zen Cart Discount Chooser Admin Panel

The page is broken into two areas: on the top, a list of existing discounts, and on the bottom, a form to allow you to add new linkages to create new discounts. The bottom part is in turn broken into two parts: the conditions (if any), and the discounted items.
For example, the configuration below shows that if you buy product 8 and product 19, you may choose from products 16 and 12 as free gifts.

Note that in Discount Chooser 1.0, a discount of 100% was implicit. In version 1.1, you may specify different discounts.

Here are the lists for the conditions and for the free gifts. As you can see, only specific numeric values (or All Products/One Each of) are permitted, so if your requirements are more complex than this, you will need to use Big Chooser and do configuration via PHP.

Zen Cart Discount Chooser Conditions Dropdown

Zen Cart Discount Chooser Gifts Dropdown


Here are the lists for the discount units.

Zen Cart Discount Chooser Units Dropdown


The units work as follows: suppose your condition product was a $100 item, and the discounted items were 3 items each of which was $10. Suppose each of these items was in the cart, as well as another $20 item which is not discounted.
  • Using discount units "Percentage off" and discount amount "10" would yield a discount of 10%*3*$10 = $3.
  • Using discount units "Currency Amount Off" and discount amount "5" would yield a discount of $5*3 = $15.
  • Using discount units "Package Final Price" and discount amount "100" would yield a discount of $130-$100 = $30. Note that the $20 item is not considered.
  • Using discount units "Package Percent Off" and the discount amount "10" would yield a discount of 10% * $130 = $13. Again, note that the $20 item is not considered.

Discount Chooser Discount Creation

This is what the screen looks like for one possible discount.

Zen Cart Discount Chooser Admin Panel


Here's what the list of discounts looks like, after they have been created:

Discount Chooser Discount List

Zen Cart Discount Chooser Admin Panel


Discounts are listed in reverse chronological order. Discounts can currently be deleted or deactivated, and as of Discount Chooser version 2.0, they may be edited. The discounts which are currently inactive are shown in red.

Discount Chooser discounts can also be made dependent on coupons. Enter the coupon code you require at the bottom of the discount entry screen in the Coupon field.

In Zen Cart, coupons must have a value. If your coupon is not for free shipping, and you don't wish to offer a second discount with the coupon (since Discount Chooser will be doing the discounting), you may set the amount to $0.001. This will make the coupon check work, but then the native Uses per Coupon and Uses per Customer functionality will not work properly. You can fix this by applying my Zero Dollar Coupon changes. These are changes to includes/modules/order_total/ot_coupon.php, which must be made in order for coupons with a value of under $0.01 to work.

In Discount Chooser 2.4 or higher, discounts may be offered to all groups (Discount Pricing Group = N/A) or a specific group, as defined in Admin > Customers > Group Pricing.

Another optional field is called Deal ID. If two discounts are assigned a non-zero Deal ID, only one of them will be applied. They are sorted and evaluated by the number of conditions (descending), then ID. So if you have
(6) Buy 1 Printers (CAT 5), Get 1 DVD Movies (CAT 3) free. (Deal ID: 1)  
(4) Buy 1 Graphics Cards (CAT 4), Get 1 DVD Movies (CAT 3) free. (Deal ID: 1) 
and you buy 1 printer, 1 graphics card and two DVD movies, you will only get one movie free. If you had not set the deal id field, you would get both movies free.

Discount Chooser is an order total module, so it appears on the second page of your checkout as a discount (unless Discount Preview is used, which allows the discount to be shown in the cart).

Please note that Discount Chooser only provides a discount; it does not automatically add items to the cart. If you need to automatically add your discounted items to the cart, take a look at Auto Add. (Note that several restrictions apply to Auto Add; please read the documentation carefully.)

Discount Chooser Discount List in Version 1.5

Zen Cart Discount Chooser Admin Panel
In version 1.5 and higher, the list of discounts has a third button, labelled with a question mark. This button shows the history of the rule: when it was first created, and if applicable, when it was last activated or deactivated. This way, if you have rules that you cycle through activating and deactivating, you can see the history of when they were updated.

Zen Cart Discount Chooser Admin Panel


Payment Page displaying Discount Chooser Discount

Zen Cart Payment page showing Discount Chooser discount


Discount Chooser Example 1

Zen Cart Discount Chooser Admin Panel

In example 1, the customer can buy a printer, and get any 3 items from mice, keyboards or CDROMs for free. So a customer could buy the printer and get 3 keyboards for free.


Discount Chooser Example 2

Zen Cart Discount Chooser Admin Panel

In example 2 by contrast, the customer can buy a printer, but may only get one item from each of from mice, keyboards or CDROMs for free. So if they bought a printer and 3 keyboards, only the least expensive keyboard would be discounted.


To change this to "Buy a printer, get an item from mice, keyboards or CDROMs for half off, simply change the Discount Amount to 50.
Zen Cart Discount Chooser Admin Panel


To change this to "Buy a printer, get an item from mice, keyboards or CDROMs for $10 off, simply change Discount Units to Currency Amount Off and the Discount Amount to 10.
Zen Cart Discount Chooser Admin Panel


To force a coupon requirement to get this discount, simply fill in the coupon code field with the coupon code you used when creating the coupon (in Admin > Gift Certificate/Coupons > Coupon Admin).
Zen Cart Discount Chooser Admin Panel




Discount Chooser Example 3

Zen Cart Discount Chooser Admin Panel

Example 3 is a classic kit discount, where the customer must buy a printer, a mouse and a keyboard in order to get a CDROM drive free.


Discount Chooser Example 4

Here are two alternate techniques for kit discounts: package final price for the entire kit, and package percent off the entire kit. (Note that this technique will work best for shops which do not have embedded taxes such as a VAT; it is not recommended if you have Display Prices with Tax set to true.)

The difference between a package offer (final price or percent off) and other offers in Discount Chooser is that for a package offer, all items must be present in order for the discount to be given. Using the above example, to set a package price of $600 for the printer, mouse, keyboard and CDROM, set the Discount Units to Package Final Price and the Discount Amount to 600.
Zen Cart Discount Chooser Admin Panel

The actual items will not change prices, but a discount to reduce the total price by the required amount will be created. This is most easily visualized by your customers when you have Discount Preview (with the subtotal feature) installed, as shown below.
Zen Cart Discount Chooser Admin Panel

To set a package percent off for a group of items, you will still express the offer in terms of a discount, but use Discount Units = "Package Percent Off." Using the above example, to set a package percent off of 15% for the printer, mouse, keyboard and CDROM, set the Discount Units to Package Percent Off and the Discount Amount to 15.
Zen Cart Discount Chooser Admin Panel


If you are using packages, please also see package discounting and promotion for information on how to promote your packages.


Discount Chooser Example 5

Let's do a more basic discount - buy four from a specific category, get the cheapest free. Now you can see that this discount can simply be restated as "Buy 3 from a category, get one more free," and this is indeed how you structure it in Discount Chooser. Let's say the category is DVD Movies. The condition is "Buy any three products" with the category set to "DVD Movies," and the discount is 100% off One DVD Movie.
Zen Cart Discount Chooser Admin Panel


Discount Chooser Example 6

In Discount Chooser 2.1, the ability to use ANY category was added. So the discount "with any purchase, get a free movie" would be implemented as shown below. Any is allowed, but it can have unexpected results if you're not clear on how it works - please see below.
Zen Cart Discount Chooser Admin Panel
If the setting Admin > Modules > ;Order Total > Discount Chooser > Repeat discounts is true, the customer would get one free movie for each item in their cart; otherwise they'd get one free movie per order.

If you have more than one condition, be sure to put "any category" as the last condition (conditions should go from most specific to least). Also bear in mind that if you have specific items as gifts (not just any), you must be sure they have lower prices than any other item, since conditions are matched from most to least expensive item, and gifts are matched from least to most expensive item). See the discussion of overlapping category specifications for the conditions and discounting for more details. Please also see Changing How Discount Chooser Works.

As an example, if your discount is:
Buy all of: product 3, any product, Get product 7 free. 
and the contents of your cart are:
 
product 3 - $29.99
product 7 - $19.99
product 5 - $10.99 
Then the discount will NOT triggered, since product 7 will be considered the second condition item (and will thus be ineligible for discount). You can change this behavior using the set_preferred_gift command, discussed below in Changing How Discount Chooser Works.

Discount Chooser Example 7

If you want to have multiple tiers for the same discount, such as:
  • Buy any 5 items from category 3, get 4 more from category 3 free
  • Buy any 2 items from category 3, get 1 more from category 3 free
You can do this. Use a non-zero deal id to indicate that the two discounts are linked, and Discount Chooser will run these discounts, executing the largest one first.

Zen Cart Discount Chooser Example 7

Using this example, if you buy 9 items from category 3, you would pay for the most expensive 5 and get the least expensive 4 free. See how discount chooser works below for details on how this is done.

Note that if your tiers have conditions that vary by more than just the number of items needed (example: tier 1 is 2 items from category 3, but tier 2 is 5 items from category 3 plus 2 items from category 7), you probably need more fine grained control offered by Big Chooser. Please contact me if you're unsure.

Package Discounting and Promotion

If you're building packages, Discount Chooser becomes even more powerful when used in conjunction with Extended Family.

Suppose you want to sell these three items as a package:
  • monitor - product #186
  • keyboard - product #25
  • mouse - product #3
The retail on these items is $219.98, but you'll sell the package for $199.

Build the package with Discount Chooser:
Zen Cart Discount Chooser plus Extended Family


If Extended Family is installed, an extra button labelled "Family" will appear when the Free Gift offer is shown. Zen Cart Discount Chooser plus Extended Family

Pressing this button will create corresponding entries in the Extended Family tables. Zen Cart Discount Chooser plus Extended Family

You will now be able to show something even more powerful on the product info page - a detailed cross sell list.
Zen Cart Discount Chooser plus Extended Family

Clicking the "Select all" checkbox means all the products will be added to the cart when the main product is added to the cart.

There is only one rule for applying discounts for packages (Package Final Price or Package Percent Off) which is different from other discounts in Discount Chooser: all items in the package must be present. So in the case above, if a customer had only the Monitor and the keyboard in their cart, they would not be eligible for a package discount until the mouse was added.

Here's a video showing all of this put together.




Changing How Discount Chooser Works

Discount Chooser first retrieves rules which have been added via its admin panel, then it runs them.

Discount Chooser retrieves the rules as follows:
  • First, rules with non zero deal ids are retrieved, ordered by deal id in descending order, then by the number of conditions in descending order. In this way, if you have two tiered deals, you can create them in any order and they will work as expected.
  • Second, rules with deal id 0 are retrieved, ordered by id in descending order. In this way, the newest rules are executed first.
  • The rules are executed from the first group first, then from the second group.
Discount Chooser each rule in the following way:
  • Items in the cart are sorted by final price, from highest to lowest.
  • When searching for an item which will match a condition, the search is from most expensive to least expensive.
  • Once all conditions have been met, searching for an item to be discounted (which will match the discounting specification) is from least expensive to most expensive.
This is generally satisfactory, but there are times when storeowners would like changes to this algorithm, and user exits are provided to do that.

The user exits are accessed by editing includes/modules/order_total/ot_freegift_chooser.php and modifying the function setup() at the bottom of the file. These functions were added in version 2.4.

We'll use some examples to see the effect of these actions.

1. Changing the Selection Order for Discounted Items

Let's assume the basket has these items:
 
product 3 (category 1) - $29.99
product 7 (category 1) - $19.99
product 5 (category 1) - $10.99 
If you have a rule that says "Buy 1 category 1, get another free," the default behavior would be to discount the $10.99 item. This is because discounted items are selected from lowest price to highest price. Some people would prefer to discount the next highest priced item (the $19.99 item). This can be done using the function set_gift_search_high_to_low. So your setup() function would look like this:
   function setup()
   {
      $this->set_gift_search_high_to_low();
   }

2. Setting preferred gifts

Let's assume the basket has these items:
 
product 3 (category 1) - $29.99
product 7 (category 1) - $19.99
product 5 (category 1) - $10.99 
If you have a rule that says "Buy product 3 and any other item, get a product 7 free," the default behavior would be to offer no discount, because products 3 and 7 are used up as conditions, so product 7 is unavailable for discounting.
You can force this to work by changing the sort order to ensure that product 7 is chosen as a gift. So your setup() function would look like this:
   function setup()
   {
      $this->set_preferred_gift(PROD, 7);
   }


How Discounts are Selected

The basic operation of all my "Buy X, Get Y at a discount" modules is the same:
  • sort from most expensive to least;
  • pick off the most expensive matching item(s) for the condition (the item(s) which must be purchased to get the discount)
  • pick off the least expensive matching item(s) to discount
  • remove the matching items from further consideration by this module (unless some sort of override exists)


Discount Chooser sorts items by price in descending order, then looks for the constraints from the top going down. Once it has found a match, it looks for the discount from the bottom going up. So if the following items are in your cart,
Product ID Category ID Price
112$4.00
518$20.00
712$5.00
912$10.00

Discount Chooser sorts them by price like this:
Product ID Category ID Price
518$20.00
912$10.00
712$5.00
112$4.00

It then matches constraints from most expensive items to least (top down), and matches discounts from least expensive items to most (bottom up).

If your discount is
(3) Buy 1 Category-12-Name (CAT 12), Get 1 Category-12-Name (CAT 12)
then this means that product 9 will be the constraint, and product 1 will be the item which is discounted 100%.

As items are used as conditions and discounted items, they are no longer available for subsequent use as conditions or discounted items. So if your cart contents are this:
Quantity Product ID Price
15$20.00
28$10.00
112$10.00

and your discount is
(3) Buy 1 Product-5-Name (PROD 5), Get 1 Product-8-Name (PROD 8)
you will only get one of product 8 for free. The second product 8 has no matching product 5.

Installation Instructions:

Upgrading Instructions:

If you are upgrading from a prior version of Discount Chooser Mega Module, follow these instructions rather than the installation instructions below:
  1. Unzip the file you received, and copy the contents of the unzipped admin and includes folders to the root directory of your shop. Note that the template name under includes is assumed to be "custom;" if you are using a different template name, please change file paths using "custom" to your template name instead. Note: If you are using Zen Cart 1.5.5 or higher, your template name will be "responsive_classic" if you have not changed it.

Prior to Installation:

  1. Go into Admin > Tools > Store Manager, and click on "Reset ALL Products Master Categories ID".

Installation

  1. Back up everything! Try this in a test environment prior to installing it on a live shop.
  2. Unzip the file you received, and copy the contents of the unzipped admin and includes folders to the root directory of your shop. Note that the template name under includes is assumed to be "custom;" if you are using a different template name, please change this prior to uploading.
  3. Run the fgc_admin.sql file against your database. You can do this in Zen Cart admin panel under Tools > Install SQL patches.
    If you are using phpMyAdmin and have used a prefix in your database, modify fgc_admin.sql to reflect this.
  4. In Admin > Modules > Order Total, click on Discount Chooser and press the Install button.
  5. Discount Chooser may now be configured in the admin panel under Tools.
  6. If your store charges tax, be sure that the sort order for the Tax module (set in Admin > Modules > Order Total > Tax) is greater than the largest order total sort order, so that your taxes are shown after all discounts.

Installation Problems:

The most common installation problems for this module are as follows:
  1. Unfamiliarity with installing mods. Please review my Guide to Mod Installation on Zen Cart.
  2. A misunderstanding of "category." A category in Discount Chooser Mega Module is "the master category of the product, and all ancestors of that category" OR "a linked category for the product." See the Category Issues page for a discussion of the treatment of categories in my mods.
  3. Some hosts require scripts which are run from a URL - for example,
    http://your-store.com/your-admin/free_gift_chooser.php
    
    to have permissions 644. You may see a message like
    HTTP 500: Internal Server Error
    
    The server encountered an internal error or misconfiguration and was unable to complete your request.
    
    when running Discount Chooser Admin if this is the case with your host. Simply set the permissions of admin/free_gift_chooser.php and admin/free_gift_chooser_backend.php to 644 using your FTP client (or perhaps your cPanel File Manager).
  4. If the Admin panel works but you don't see discounts on the catalog side, you may not have run the admin side install. Go to Admin > Modules > Order Total, click on Discount Chooser and press the Install button.
  5. If try to run the Admin Panel and get an error like
    1146 Table 'yourdb.zen_free_gift_chooser' doesn't exist
    in:
    [SELECT * FROM zen_free_gift_chooser ORDER BY id DESC ]
    If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.
    
    this means you ran the sql script in phpMyAdmin without adding the prefix manually. You can avoid this problem by running SQL scripts in Admin > Tools > Install SQL Patches.
  6. If you are granting access to Discount Chooser to a non-superuser in Zen Cart 1.5.x, you must make a change to a core file. In admin/includes/init_includes/init_admin_auth.php, add FILENAME_FREE_GIFT_CHOOSER_BACKEND to the list of files checked on line 49.
  7. If you wish to use coupons with Coupon Amount 0.001 (and no free shipping), then you must apply my Zero Dollar Coupon changes.
  8. If you are pulling in jQuery and/or jQueryUI already in your admin panel, you will need to comment out the require statements that do that in ./admin/free_gift_chooser.php.
  9. If you are running 1.3.9 or prior with the Admin Profiles contribution, there are a few more steps. you must install the software, then go to Admin > Tools > Admin Settings, and check 'Discount Chooser' under the tools menu. Then go to Admin > Tools > Discount Chooser, and you'll get an error message in the form where discounts are entered. Go back to Admin > Tools > Admin Settings, and check 'Discount Chooser backend'. Now Admin > Tools > Discount Chooser will work.
  10. Got a blank page? Review the guidelines for Debugging a blank page in Zen Cart
  11. If the line items for your order don't add up correctly, the most likely root cause is taxes. Two things to note:
    • If you use embedded taxes (i.e. Admin->Configuration->My Store->Display Prices with Taxes = True), have a mix of taxable and tax-free products, or have a different rate of tax for shipping, please read my Notes on Special Tax Situations.
    • Be sure that the sort order for the Tax module (set in Admin->Modules->Order Total->Tax) is greater than the largest order total sort order, so that your taxes are shown after all discounts. 399 is a good value for most stores.
    • To get more details on how taxes work in Zen Cart, please read my Example Description of Tax Handling.
  12. If you are upgrading from a very old copy of this mod, you may need to rerun the table creation script, since the tables have changed. Note your current discounts and then go to Admin > Tools > Install SQL Patches and run fgc_admin.sql. Then re-add your discounts.
  13. Did you read the incompatibilities list? You may have too many categories, for example. If this describes you but you have already bought the software, please contact me; I may be able to write some custom logic (at additional cost) to help you make this mod work.
If you are having trouble installing this module, you should also refer to my Guide to Mod Installation on Zen Cart. I'm also happy to install most of my mods for a fee.

Optional Installation Instructions:

  1. I highly recommend Discount Preview with all my discounting modules. Without Discount Preview, your customers cannot see the price reductions they are entitled to until the second page of checkout (checkout confirmation). Obviously this is a disadvantage, particularly for new customers who need to go through the additional step of creating an account before they can see this information. Sometimes seeing is believing, so here's a video showing Discount Preview in action.


Marketing

What good is having cross selling and upselling specials if you don't advertise them?

Discount Chooser Discounts may be automatically displayed in several places: on the product info page, the shopping cart page, and on a separate promotional page. We'll talk about the product info page first.

Customize the tpl_product_info_display.php file to advertise your discounts. Copy the file includes/templates/template_default/templates/tpl_product_info_display.php into includes/templates/<YOUR_TEMPLATE>/templates
Then add this block of code to the new copy of tpl_product_info_display.php:
<?php 
require($template->get_template_dir('/tpl_freegift_chooser_marketing.php',DIR_WS_TEMPLATE, 
   $current_page_base,'templates'). '/tpl_freegift_chooser_marketing.php');
?>
The placement of this code is a matter of personal preference; try placing it below the product description and adjust to your tastes. It creates a message on your page that looks like what you see at the top of Discount Chooser Admin, except with links instead of product or category ids. This message only shows up for discounts that are relevant to the product being viewed.

Buy 1 from category DVD Movies, Get 1 from category DVD Movies free.

Only one div block of text will be produced, with the div id freegiftChooserDiscountPolicy.

You may also use the same block of code on your shopping cart page. Again, start by creating includes/templates/<YOUR_TEMPLATE>/templates/tpl_shopping_cart_default.php
Then add the block of code
<?php 
require($template->get_template_dir('/tpl_freegift_chooser_marketing.php',DIR_WS_TEMPLATE, 
   $current_page_base,'templates'). '/tpl_freegift_chooser_marketing.php');
?>
below the start of the page. It will show all your active Discount Chooser discounts.

The other available marketing vehicle is the Discount Chooser Discount promotional page. This page is completely optional; it is not included in the Discount Chooser zip archive, but it is a free download from my website for people who have purchased Discount Chooser. It creates a new page page for your site that allows you to

This new page can be accessed via the URL
YOURSITE.com/index.php?main_page=freegiftchooser_promo
A link to this page may be added to the categories sidebox, the site footer, or the main page content for your site. See Promotional Pages for more information and ideas.

Notes on Taxes


If you don't use embedded taxes, and don't have a mix of taxable and tax-free products, and don't have a different rate of tax for shipping, please skip this section.
However, if you any of the above apply to you, please read my Notes on Taxes.

Be sure that the sort order for the Tax module (set in Admin->Modules->Order Total->Tax) is greater than the largest order total sort order, so that your taxes are shown after all discounts. 399 is a good value for most stores.

Running Discount Chooser

One tip I have for successfully operating Discount Chooser is to get in the habit of using Set Inactive (instead of Delete) for rules you're no longer using. This gives you a way of easily bringing them back, or comparing to your current rules.

Major Versions

  • 2.7 02/12/2022 - PHP 8 updates
  • 2.6 06/04/2021 - Updates for Zen Cart 1.5.7 and newer MySQL versions
  • 2.5 12/21/2018 - PHP 7 updates
  • 2.4 09/01/2017 - Add Group Selection per discount, ensure conditions and gifts are evaluated in the order input, add user exits
  • 2.3 08/01/2017 - Add "Copy to Extended Family"; resolved some issues in Final Price package handling
  • 2.2 03/01/2017 - Make links the default in marketing text.
  • 2.1 02/05/2017 - Allow use of "any" category, updates for MySQL 5.7.
  • 2.0 01/01/2016 - Added edit feature.
  • 1.5 06/13/2015 - Added display of linkage history.
  • 1.4 04/03/2015 - Issue with final price packages when choices are used.
  • 1.3a 12/06/2014 - Fix for payment modules with their own application_top files (e.g. Paychex).
  • 1.3 10/04/2014 - Adding ability to discount packages
  • 1.2 08/01/2014 - Adding ability to use linked categories
  • 1.1 04/01/2014 - Added discounting capability
  • 1.0a 08/03/2013 - Fixed some issues which appear in newer browsers
  • 1.0 05/01/2013 - First release
  • 0.9 04/25/2013 - Beta release

Interoperability

  • If you are using Zen Cart 1.5.x and Edit Orders 4.x and Discount Chooser, you must make the following change:
    Create a file called admin/includes/functions/extra_functions/free_gift_chooser_lookups.php
    It should contain this code:
    <?php
    if (! function_exists('zen_get_products_manufacturers_id')) { 
      function zen_get_products_manufacturers_id($product_id) {
        global $db;
    
        $product_query = "select p.manufacturers_id
                          from " . TABLE_PRODUCTS . " p
                          where p.products_id = '" . (int)$product_id . "'";
    
        $product =$db->Execute($product_query);
    
        return $product->fields['manufacturers_id'];
      }
    }
    


Bugs

  • For recalculate tax = Standard, carts using Edit Orders 4.3.1 will need to change the process() function in the code file in includes/modules/order_total as follows:
    Change
                   if ($this->calculate_tax != 'VAT') {
                      $order->info['total'] -= $od_amount[$key];
                   }
    
    to
                   if (!IS_ADMIN_FLAG) {
                      if ($this->calculate_tax != 'VAT') {
                         $order->info['total'] -= $od_amount[$key];
                      }
                   }
    
  • If you are using Discount Chooser 1.3 or lower, with a payment module which has its own application_top file (such as Nochex), please move
    includes/extra_configures/free_gift_chooser_tables.php
    
    to
    includes/extra_datafiles/free_gift_chooser_tables.php
    
    (The symptom you will see is that customer checkouts will fail to complete.) This issue is fixed in version 1.3a.


Discount Chooser versus other Discounting Modules

Module Comparison
Better Together Better Together supports two for one offers across a category; this allows you to create a "Buy one, get one of the same item" promotion. With Discount Chooser, you can only do "Buy one, get another from the same category." (Note that the lower priced item is always the one that gets discounted in this scenario.)
Better Together supports cross sells.
Better Together requires a separate Better Together admin panel (unless you wish to use the PHP based configuration facility).
Better Together allows you to set the discount amount, but only allows 1 condition and 1 discounted item.
Combination Discounts Discount Chooser allows you to require a choice of or all of up to 12 items as mandatory conditions for receiving a discount.
Combination Discounts allows you to have multiple mandatory conditions, but does not allow a choice of a subset of those items.
Combination Discounts requires a separate Combination Discounts admin panel (unless you wish to use the PHP based configuration facility).
Big Chooser Big Chooser allows you to specify exceptions to conditions and discounts, to make discounts mutually exclusive, to make some constraints mandatory and others selectable, to constrain by price or manufacturer, to do attribute level matching, and a variety of other advanced features which are not available in Discount Chooser. However, Big Chooser is configured using a PHP API, which is may be too complex for shopowners without programming experience.
Unique to Discount Chooser
  • Discount Chooser allows you to create a package final price for a set of products. None of my other modules have this feature.
  • Discount Chooser allows category specifications to reference linked categories (not just the master_categories_id and ancestors). Free Gift Spender is the only other of my modules to have this feature.


FAQ

Q: Why do Linked Categories only work in Discount Chooser/Spender?
A: The definition of a "category" in Discount Chooser/Spender is different from all other mods (such as Table Discounts, Big Chooser and so forth). It is "the master category of a product, and all that category's ancestors" AND "a linked category for the product." See the Category Issues page for a discussion of the treatment of categories in my mods.

Q: Where's Checkout Candy for Discount Chooser?
A: The complexity of the specification mechanism for Discount Chooser makes it very difficult to create a workable Checkout Candy algorithm. Instead, I created Big Upsell.

Q: I'm using a category based discount and it's not working!
A: There are several possible root causes. Please see the Category Issues page for solutions.

Q: Why does using overlapping categories for my condition and discounted item not work?
A: Discount Chooser is not designed to handle BOGO sales, so having overlapping category specifications for the conditions and discounted items causes issues. This issue (and some possible remedies) is discussed on this page. But really, if you want to do these types of discounts, you're better off with one of my other modules: Better Together (buy 1, get 1), Combination Discounts (buy m, get n), or BOGO Discount (cart-wide BOGO, optionally limited). For complex discounts with multiple conditions, Big Chooser can be used.

Q: Do package final price discounts reduce the unit price of items?
A: No! A package final price discount simply creates a discount such that the price of the items in question minus the discount is equal to the package final price. For example, here is a demonstration of "Buy 4 movies for $100" using Discount Chooser, with the discount shown on the Shopping Cart page by Discount Preview.
Zen Cart Package Final Price Discount using Discount Chooser


Q: Why do I have to enable Javascript to run the Discount Chooser Admin Panel?
A: Because it uses AJAX, a Javascript based technology. This creates a faster, more responsive user interface. If you do not enable Javascript in your browser, you will see a flashing red error message at the top of the page, and the Discount Chooser Admin Panel will not operate.

Q: Why is it called Discount Chooser?
A: In the original vision and first releases, it only offered 100% discounts. I later realized it would be much more useful to permit flexible levels of discounting.

I charge a fee of $60 for the Discount Chooser Mega Module. Buy Discount Chooser.
The fee covers software only; installation is extra if you require help.