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

Zen Cart Buy The Set

Zen Cart Buy The Set for Combination Discounts

Buy the Set is a Zen Cart™ extension which allows your customers to purchase all items in a Combination Discounts grouping with a single click. The items must be products (specified with PROD) which do not have attributes.

Relevance: Zen Cart™ 1.3.9, 1.5.x, along with Combination Discounts.
This extension is part of the Zen Cart Combination Discounts World.

Current Version: 1.1.
Occasionally, new features are documented prior to being publicly available; please check the version history to ensure the feature you want is available in your version.

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

Cost: $90. (Note: this low price covers software only for self-installation.)

Buy Now

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: $190 (Professional installation by That Software Guy)

Installation Difficulty: Moderate

Installation Instructions: click here

Buy: Get Buy the Set Now!
Pre-purchase questions? No problem! Just Please contact me with your question.

FAQ: click here

Restrictions: click here. Please read this section carefully; if you have questions, please contact me before purchasing.

See it Live: Go to product 9 in my demo shop you will see the cross-sell message for two other products, along with a button that allows all three products to be purchased with a single click.

The code that created this Combination Discounts linkage was:
         $this->add_linkage(PROD,12,1,PROD,9,1,PROD,18,1,"$", 30);

If you add all these products to your cart, you will be able to see the discount in your cart because of Discount Preview


This product complements my Combination Discounts extension by allowing you to have a single button that adds all the items to the cart. The button is displayed on the product info page for products which do not have attributes and which are linked using an add_linkage() statement with only PROD purchases specified.

Product Info Page displaying Buy The Set

Zen Cart Combination Discounts with Buy The Set


  1. The linkage must be use PROD purchases only; linkages with CAT or PRICE will not display a "buy the set" button.
  2. The products in the linkage must not have attributes.
  3. The marketing text must be at the very top (recommended) or the very bottom of the page. Details are provided in the README file.
  4. Buy The Set is for Combination Discounts only; it does not understand Better Together linkages. For Better Together, see Buy Both Now.
Note that Buy The Set works best with Discount Preview. This way, customers can see their discount on the shopping cart page instead of having to wait for the Checkout Payment page.

Installation Instructions:

  1. Back up everything! Try this in a test environment prior to installing it on a live shop.
  2. Copy the contents of the unzipped folder to the root directory of your shop.
    The names of these files reflect a template name of "custom." If you are using a different template name, please change file paths using "custom" to use 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.
  3. Login to admin and in Modules > Order Total you will see 'Combination Discounts' listed along with all the other modules available.
  4. Click on 'Combination Discounts' to highlight the module and click on 'Install'
  5. Decide on the discounts you wish to use. The easiest way to do this is to open a shopping cart in another window, and just start adding discounts to the setup() method of includes/modules/order_total/ot_combination_discounts.php The discounts are shown on the second step of checkout in "Your Total" under "Combination Discounts."
  6. Add the marketing text to the product info page.
    NOTE: The positioning of the marketing text for Buy The Set is critical. There are only TWO places this block of code may be inserted. It must be either immediately before the first bof Form start or immediately after the last bof Form close in the file tpl_product_info_display.php If you put it inside the form, Buy The Set will not operate correctly.

Installation Problems:

The most common installation problems for this module are as follows:
  1. Forgetting to put the marketing text either before or after the <form> tag. The marketing text cannot be placed arbitrarily on the page with Buy The Set; it must be before or after the form begins or ends. See the README that comes with the module.
  2. Trying to use Buy The Set on items with attributes. Buy The Set only works on all-product linkages with no attributes.
  3. If your template uses CSS buttons, then you'll need to make a small change: Edit the file includes/functions/extra_functions/checkbts_pi.php At the bottom, replace $bts_string_end = '<input type="image" src="' . $button . '" alt="Buy the set" title="Buy the set" /></form>';
    $bts_string_end = "  " . zen_image_submit($image, "Buy the set") . "</form>";
  4. Got a blank page? Review the guidelines for Debugging a blank page in Zen Cart
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.

Major Versions

  • 1.1 12/20/2018 - Updates for PHP7
  • 1.0.9a 03/06/2012 - Update for Zen Cart 1.5.0 (Buy the Set only)
  • 1.0.9 02/12/2012 - Fix for Buy The Set (others don't need this change)
  • 1.0.8 05/10/2010 - Some PHP5's didn't handle quantities correctly
  • 12/03/2009 - Added VAT setting for taxes
  • 02/14/2009 - Error in PRICE marketing text
  • 1.0.7 12/14/2007 - 1.3.8 Compatibility
  • 1.0.6 10/17/2007 - Error in reverse discounting text
  • 1.0.5 09/26/2007 - Bad error handler
  • 1.0.4a 09/18/2007 - Google Checkout fix
  • 1.0.4 08/22/2007 - Add any level of category matching; consolidate marketing text to a single div (and only display if appropriate).
  • 1.0.3 07/24/2007 - Add "by price" linkages, put marketing code in a file.
  • 1.0.2 05/31/2007 - Enabling "get lowest price item" type discounts.
  • 1.0.1 05/06/2007 - Integration with Checkout Candy
  • 1.0 04/07/2007 - First Created.


Q: Why doesn't Buy The Set work with products with attributes?
A: Buy The Set automatically adds the items in the discount to the cart. You can't just add something with attributes to the cart automatically because you don't know the correct attribute settings; there are as many possibilities as the arithmetic product of the number of options. There's no way to know which one is right. So then the customer would have to go in and modify that item and add a new one with the correct attributes (because you can't edit an item in the cart), and then delete the old one. In addition, if there was JavaScript validation of the attributes, this would be sidestepped if I allowed Buy The Set to automatically add items to the cart. So given all these complications, I decided to not allow it and clearly advertise this fact.

I charge a fee of $90 for Buy The Set. Get Buy The Set!
The fee covers software only; installation is extra if you require help.