That Software Guy, Inc.'s Logo

Software Consulting Services
Need Help? Call That Software Guy!


big spender

Big Spender

A discounting module for Zen Cart™ that allows you to discount products at certain levels of spending.

Background: See the Zen Cart Matrix-o-discounts

Relevance: Zen Cart™ 1.3.5 and forward

Cost: $60

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

Promotional Page Download: free from my website (you must buy Big Spender separately)

See it Live: Go to product 2 in my demo shop (or any other hardware item) you will see the upsell message that if you buy $200 or more of hardware, you get two free movies. Going to a DVD movie will show the same message.


The code that created this Big Spender Discount was:
         $this->add_threshold(200, 'Spend over $200 on hardware, get two movies free', false);
            $this->set_constraint(CAT, 1);
            $this->set_choice_discount(2, CAT,3,"%",100);


Add-Ons:
If you buy enough hardware items to pass the $200 threshold and then add the movies to your cart, you will be able to see the discount in your cart because of Discount Preview.

Here is a sample of the Big Spender Discount promotional page, which is described in this tip.
You can display your promotions on the shopping cart page and the checkout shipping page using Big Upsell.
The code that created the additional supporting text on the promotional page was:
            $this->set_support('Enjoy your new computer with your choice of two free movies');
            $this->set_support('We have many many choices - comedy, drama, action and cartoons');
            $this->set_support('Link to mfr: - <a href="http://www.intel.com" target="_blank">Intel</a>');
            $this->set_support('<a href="articles/Sample_PDF.pdf">Sample PDF document</a>');

This text may also be displayed on the product info page if desired.

FAQ: click here

Installation: click here

Current Version: 1.1.7. 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.

Overview:

My Quantity Discounts Contribution allows you to discount the purchase of specific quantities of items, where items can be grouped and counted in a number of ways. Every once in a while though, people ask me to modify the contribution to discount by dollars spent (typically with a few exceptions or exemptions). This is a modification which I do for $30.

Increasingly, however, I have been receiving more complex requests for discounts based on dollars spent. Typically these are initiated after a certain dollar threshold is exceeded. The most common of these is, "provide a free gift after with purchases of a certain amount," or, "provide additional discounts on further purchases after a certain amount has been spent."

None of my existing modules is adequate for this task. This requires a new approach to specifying both conditions and discounts. Hence, Big Spender.

Big Spender Discount is modelled after my Combination Discounts extension. Combination Discounts introduced the idea of having a very flexible specification mechanism to allow the implementation of many different discounting models without the need for costly custom programming. Big Spender builds on this idea.

Big Spender is configured by setting "thresholds" and then parameterizing these thresholds, specifying the discounts available once the threshold is exceeded, and (optionally) specifying how the threshold is to be determined, if it is anything other than the total value of all cart items.

Big Spender requires you to add these thresholds and parameters to the module itself - they are not configured through the admin panel. This sounds complicated, but it's not that bad, and many examples of common discounting practices are provided. Please note that Big Spender only provides a discount; it does not automatically add items to the cart.

The calling conventions for building a threshold are as follows:

{ dollar figure, text description, whether to apply the behavior multiple times }

So suppose the discount was stated as, "After $200 is spent, take some action." This would be

   $this->add_threshold(200, "Spend over $200 and get ...", false); 

If the discount was, "For every $200 spent, take some action," the code would be
   $this->add_threshold(200, "For every $200 spent, get ...", true); 

Now we need to parameterize the threshold. Parameter statements apply to the threshold statement they immediately follow. I have provided a visual cue for this by indenting the parameter statements on this page by three spaces. The following types of parameter statements are currently supported:

  • set_discount - discount some product or category by a specific percentage or currency figure
  • set_choice_discount - discount a specified number of items from some product or category by a specific percentage or currency figure
  • set_cart_discount - discount the entire cart by a specific percentage or currency figure
  • set_constraint - determine whether the threshold has been crossed by totalling the value of only the specified products or categories
  • set_negative_constraint - determine whether the threshold has been crossed by totalling the value of all products except those specified
  • set_deal_id - giving the discount an identifying number to allow other discounts to be filtered out if this number has been run
  • set_no_double_dip - specifying which discounts which, if executed, will cause this discount to be skipped
  • set_group - only apply this discount to members of the listed groups
  • set_min_items - apply this discount only if at least this many items are in the cart and meet the other criteria

One of set_discount(), set_choice_discount() or set_cart_discount() must be done for every threshold for it to have any action. The use of set_constraint() is optional.

The discount, "Spend over $200, get a free product 5" would be specified as

   $this->add_threshold(200, "Spend over $200 and get a free name-of-product-5", false); 
      $this->set_discount(PROD, 5, 1, "%", 100); 

The discount, "For every $200 spent, get $20 off an item from category 7" would be specified as

   $this->add_threshold(200, "For every $200 spent, get $20 off an item from name-of-category-7", true); 
      $this->set_discount(CAT, 7, 1, "$", 20); 

Now let's add a constraint. The discount, "For every $200 spent from category 3, get two free items from category 7" would be specified as

   $this->add_threshold(200, "For every $200 spent from category 3, get two free items from category-7", true); 
      $this->set_discount(CAT, 7, 2, "%", 100); 
      $this->set_constraint(CAT, 3); 

Now let's add choices. The discount, "For every $200 spent from category 3, get your choice of 2 free gifts from products 20, 25, 30, 35, or 40" would be specified as

   $this->add_threshold(200, "For every $200 spent from category 3, select 2 free gifts... ", true);
      $this->set_choice_discount(2, PROD, 20, "%", 100, 
                                 PROD, 25, "%", 100,
                                 PROD, 30, "%", 100,
                                 PROD, 35, "%", 100, 
                                 PROD, 40, "%", 100);
      $this->set_constraint(CAT, 3); 

What if instead of category 3, you wanted to provide a discount for spending on certain types of products which were spread across categories. We'll call this product class "open stock cookware," and assume that it is made up of product ids 1, 3, 5, 11, 13, 19, 37, and 41. We'll only allow this discount to be offered once per order.

   $this->add_threshold(200, "Spend over $200 on open stock cookware, select 2 free gifts... ", false);
      $this->set_choice_discount(2, PROD, 20, "%", 100, 
                                 PROD, 25, "%", 100,
                                 PROD, 30, "%", 100,
                                 PROD, 35, "%", 100, 
                                 PROD, 40, "%", 100);
      $this->set_constraint(PROD, 1, PROD, 3, PROD, 5, PROD, 11, PROD, 13, PROD, 19, PROD, 37, PROD, 41); 

Discounting can be done in currencies as well. To offer $5 off (or 5 of whatever currency your cart uses), instead of 100% off, use
   $this->add_threshold(100, "Spend over $100, select 2 free gifts... ", false);
      $this->set_choice_discount(2, PROD, 20, "$", 5, 
                                 PROD, 25, "$", 5,
                                 PROD, 30, "$", 5,
                                 PROD, 35, "$", 5, 
                                 PROD, 40, "$", 5);

(The "$" is just used to specify currency; your cart's currency settings will be respected when computing the discount.)

Constraints can be specified in the opposite manner; to total all items in the cart except for gift certificates (category 21), use set_negative_constraint():
   $this->add_threshold(100, "Spend over $100 (excluding gift certificates), get a free product 20", false);
      $this->set_negative_constraint(CAT, 21);
      $this->set_discount(PROD, 20, 1, "%", 100); 

The discount, "Spend over $200, get 20% off one item priced at $100 or more" would be specified as

   $this->add_threshold(200, "Spend over $200, get 20% off one item $100 or more", false); 
      $this->set_discount(MINPRICE, 100, 1, "%", 20); 


Discounts can also be limited to certain groups using set_group():
   $this->add_threshold(100, "Spend over $100, get a free product 20", false);
      $this->set_group(1,3,7);
      $this->set_discount(PROD, 20, 1, "%", 100); 


Discounts can be made to require the purchase of a minimum number of items:
   $this->add_threshold(100, "Spend over $100 on at least 3 items, get a free product 20", false);
      $this->set_min_items(3);
      $this->set_discount(PROD, 20, 1, "%", 100); 


Sometimes you may wish to tier your discounts
   $this->add_threshold(500, "Spend $500 get five free product 20", false);
      $this->set_discount(PROD, 20, 5, "%", 100); 
   $this->add_threshold(100, "Spend $100 get a free product 20", false);
      $this->set_discount(PROD, 20, 1, "%", 100); 

Big Spender does not know that these are related, so this would allow someone spending over $500 to take six free product 20. To indicate that discounts are exclusive, use set_deal_id() and set_no_double_dip().
   $this->add_threshold(500, "Spend $500 get five free product 20", false);
      $this->set_discount(PROD, 20, 5, "%", 100); 
      $this->set_deal_id(1);
   $this->add_threshold(100, "Spend $100 get a free product 20", false);
      $this->set_discount(PROD, 20, 1, "%", 100); 
      $this->set_no_double_dip(1);
Note that when this is done, the highest discount should be specified first; otherwise, a lower discount will block a higher discount.

A set_no_double_dip() on the first threshold and a set_deal_id() on the last are not required but may be specified; the above block is identical to this:
   $this->add_threshold(500, "Spend $500 get five free product 20", false);
      $this->set_discount(PROD, 20, 5, "%", 100); 
      $this->set_deal_id(1);
      $this->set_no_double_dip(2);
   $this->add_threshold(100, "Spend $100 get a free product 20", false);
      $this->set_discount(PROD, 20, 1, "%", 100); 
      $this->set_deal_id(2);
      $this->set_no_double_dip(1);


These thresholds and parameters are not only used in discount calculations; they are also used to create messages which are automatically displayed on the product_info page. Details on how to do this are provided in marketing.

Big Spender 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).

Payment Page displaying Big Spender Discount

Payment page showing Big Spender Discount

Detailed Description:

Thresholds and parameters are specified in the setup() method at the bottom of the class. There is no admin interface; you must modify the file

includes/modules/order_total/ot_bigspender_discount.php

Any number of these discounts may be offered; discount computation will be done in the following order:
  • Thresholds are calculated in the order in which they are specified in setup()
  • For each threshold, the set_discount() and set_cart_discount() statements are executed first (in the order they were specified), then the set_choice_discount() statements (in the order they were specified)
  • Once an item has been discounted, it is not subject to re-discounting, even if rules would permit it
  • Items in the cart are discounted from least expensive to most expensive.


To make these discounts visible on your product info page, customize the file

includes/templates/template_default/templates/tpl_product_info_display.php

as described in marketing below in the installation instructions. This step will display the message you provided in the add_threshold() command:

For every $200 spent on open stock cookware, select 2 free gifts ...

The message is displayed to encourage the customer to cross the threshold. It is displayed on any item which will contribute to crossing the threshold *and* any item which is discounted after crossing the threshold.

This step is optional; if you prefer, you can add your own marketing text.

Note that CAT has different semantics in Big Spender when compared to Better Together. In Better Together, CAT only includes items directly below the specified category (i.e. CAT means "parent category"). In Big Spender, CAT includes all items below the specified category, whether they are directly below or in subcategories.

Men's Clothing (category 3)
     |
     ---->  Shirts (category 5)
     |      |
     |      -------> shirt A 
     |               shirt B
     |               shirt C 
     ---->  Pants (category 6)
     |      |
     |      -------> pants A 
     |               pants B
     |               pants C 
     ---->  Shoes (category 7) 
     |
      --------->  Dress Shoes (category 12) 
     |            |
     |            -------> dress shoes A 
     |                     dress shoes B
     |                     dress shoes C 
      --------->  Casual Shoes (category 18) 
                  |
                  -------> casual shoes A 
                           casual shoes B
                           casual shoes C 

Specifying "Men's Clothing" as a category in Big Spender will include all items in Shirts, Pants and Shoes. This cannot be done in Better Together without the Top Level Category extension.

Specifying "Shoes" (CAT 7) as a category will include both dress shoes and casual shoes. This cannot be done in Better Together without the Multilevel Category Extension.

Furthermore, because of the ability to specify categories in both the negative and positive manner, you can create a discount which is triggered by spending over $100 on Men's Clothing, excluding shoes:
   $this->add_threshold(100, "Spend over $100 on Men's clothing (excl. shoes), get a free product 20", false);
      $this->set_constraint(CAT, 3);
      $this->set_negative_constraint(CAT, 7);
      $this->set_discount(PROD, 20, 1, "%", 100); 


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.
  3. Login to admin and in Modules->Order Total you will see 'Big Spender Discount' listed along with all the other modules available.
  4. Click on 'Big Spender Discount' 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_bigspender_discount.php. The discounts are shown on the second step of checkout in "Your Total" under "Big Spender Discount."
  6. You may wish to use a less silly name than "Big Spender Discount." If so, modify the file includes/languages/english/modules/order_total/ot_bigspender.php.
  7. If you wish, follow the guidelines in marketing to advertise your discounts.
  8. Light a cigar with a $100 bill. You are now a Big Spender!



Marketing

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

Big Spender Discounts may be automatically displayed in two places: on the product info 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_bigspender_marketing.php',DIR_WS_TEMPLATE, 
   $current_page_base,'templates'). '/tpl_bigspender_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 uses the description you provided in the add_threshold():

For every $200 spent on open stock cookware, select 2 free gifts ...


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

The file tpl_bigspender_marketing.php also contains additional print statements which are commented out, but which you may uncomment if desired. These include:
  • An indication of whether this product contributes towards reach the threshold and/or is discounted after the threshold is reached
  • The display of additional "supporting" text for the discount that you have added using $this->set_support(). Such text can include links to PDFs, links to products in your cart, links to external pages, or simply descriptive text. This text will be automatically displayed on the Big Spender Discount promotional page.

Styling this block of text (changing font, color, etc.) is simply a matter of adding to your stylesheet

#bigSpenderDiscountPolicy {
   font-size: 200%;
   color: #ff0000;
}
This would give you

For every $200 spent on open stock cookware, select 2 free gifts ...

Probably a bit more obnoxious than you would truly want, but you get the idea.

Alternately, you could modify the marketing text template (tpl_bigspender_marketing.php) and put the text into a fieldset:

 Big Spender Discounts 
For every $200 spent on open stock cookware, select 2 free gifts ...


The approach to marketing text for Big Spender is different than the one used in Better Together or Combination Discounts, in that it is not triggered by a particular product. Instead, it is globally displayed on all product info pages unless that product is constrained out of the discount. So for instance, if you have
   $this->add_threshold(100, "Spend over $100 on Men's clothing (excl. shoes), get a free product 20", false);
      $this->set_constraint(CAT, 3);
      $this->set_negative_constraint(CAT, 7);
      $this->set_discount(PROD, 20, 1, "%", 100); 
then the marketing text will appear on pages for products in category 3 (and subcategories), and on the page for product 20, but not on pages in category 7 (and subcategories). If the two constraints were not specified, the marketing text would appear on all product info pages. Note that price based constraints are not used to filter out marketing text because the final price of a product may not be known on the product info page.



The other available marketing vehicle is the Big Spender Discount promotional page. This page is completely optional; it is not included in the bigspender.zip file, but it is a free download from my website for people who have purchased Big Spender. It creates a page that looks like this, displaying all discounts and supporting text.

Files

(new)  includes/languages/english/modules/order_total/ot_bigspender_discount.php
(new)  includes/modules/order_total/ot_bigspender_discount.php
(new)  includes/templates/custom/templates/tpl_bigspender_marketing.php


Formal Syntax of Thresholds and Parameters

Thresholds and Parameters, which are specified in the setup() function of ot_bigspender_discount.php, are the mechanism for configuring a store's discounts.

Thresholds

Discounts always begin by specifying a spending threshold. All subsequent parameters (until the next threshold) apply to this threshold.

$this->add_threshold(<amount>,<description>,<repeatable>);

where:
amountis the cart total above which the discounts apply
descriptionIs a textual description of the discount. This description is not automatically created the way it is in Better Together or Combination Discounts; it must be added manually. The reason for this is to allow greater flexibility
repeatableis a boolean flag indicating whether to apply the discount only one time (false) or as many times as possible (true).


Parameters - set_discount

The set_discount() command specifies the items or categories whose prices should be reduced if the threshold has been met.

$this->set_discount(<discount 1>[,<discount 2>,...,<discount n>]);

where:
discountis the string PROD, CAT, PRICE or MINPRICE followed by an identifier (product or category id, or product price), followed by a quantity, followed by a percent or dollar sign, followed by an amount

<PROD | CAT | PRICE | MINPRICE> <product or category identifier or price> <item count> < "$" | "%" > <discount amount>
The item_count may be specified as "*", meaning "the discount may be taken an unlimited number of times."


Parameters - set_cart_discount

The set_cart_discount() command specifies the reduction in the total cart price that should be done if the threshold has been met.

$this->set_cart_discount(<"$"|"%">, <discount_amount>);

where:
price reductionis a percent or dollar sign, followed by an amount


Parameters - set_choice_discount

The set_choice_discount() command specifies that the customer may choose between a series of discounts if the threshold has been met.

$this->set_choice_discount(<count><choice 1>,<choice 2>[,...,<choice n>]);

where:
countis the number of discounts the customer will receive; it must be a numeric quantity
choiceis the string PROD, CAT, PRICE or MINPRICE, followed by an identifier (product or category id, or product price), followed by a percent or dollar sign, followed by an amount

Note that this is different from the discount specified in set_discount because no explicit quantity is specified per choice; the quantity set at the level above.
<PROD | CAT | PRICE | MINPRICE> <product or category identifier or price> < "$" | "%" > <discount amount>


Parameters - set_constraint

The set_constraint() command specifies the items whose prices are used to determine if the threshold has been passed. If this command is not specified, the total price of all items in the cart is used.

$this->set_constraint(<qualifying_purchase 1>[,<qualifying_purchase 2>,...,<qualifying_purchase n>]);

where:
qualifying_purchaseis the string PROD, CAT, PRICE or MINPRICE, followed by an identifier (product or category id, or product price)

<PROD | CAT | PRICE | MINPRICE> <product or category identifier or price>


Parameters - set_negative_constraint

The set_negative_constraint() command specifies the items whose prices are NOT used to determine if the threshold has been passed. If this command is not specified, the total price of all items in the cart is used.

$this->set_negative_constraint(<excluded_purchase 1>[,<excluded_purchase 2>,...,<excluded_purchase n>]);

where:
excluded_purchaseis the string PROD, CAT, PRICE or MINPRICE, followed by an identifier (product or category id, or product price)

<PROD | CAT | PRICE | MINPRICE> <product or category identifier or price>


NOTE: A negative constraint does not mean "the item must not be in the cart;" it simply means "the item is not counted towards the reaching the total."

Parameters - set_support

The set_support() command provides additional supporting text to describe your promotion. It is completely optional.

$this->set_support(<text>);

where:
textis a text string, which can be plain text or a link

These strings are displayed on your promotional page, and optionally, on your product info page if you customize the file includes/templates/custom/templates/tpl_bigspender_marketing.php

Parameters - set_deal_id

The set_deal_id() command allows you to give a threshold and its associated discount an id, to allow later discounts to be filtered out if this discount has been run using set_no_double_dip. This parameter is optional and is only needed for discounts which preclude other discounts.

$this->set_deal_id(<nnnn>);

where:
nnnnis some number which identifies this threshold or group of thresholds.

For convenience, use the same id for all members of a related group of thresholds ("Spend $1000, get..", "Spend $500, get ...", "Spend $250, get ...") where you only want the highest value discount to be executed.

Parameters - set_no_double_dip

The set_no_double_dip() command allows you to give a specify that if a certain discount has already been run, the current discount should be skipped. This parameter is optional and is only needed for discounts which preclude other discounts.

$this->set_no_double_dip(<nnnn>);

where:
nnnnis the id which was used in a set_deal_id() command for one or more previous thresholds.

Multiple set_no_double_dip commands may be used as required.

Parameters - set_group

The set_group() command specifies that the discount is only available to members of the listed group(s).

$this->set_group(<group 1>[,<group 2>,...,<group n>]);

where:
groupis the group eligible to receive the discount


Parameters - set_min_items

The set_group() command specifies that the discount is only available to if a certain number of items or more are purchased and meet the other discount requirements.

$this->set_min_items(<nnnn>);

where:
nnnnis the minimum number of items required to get the discount.


Major Versions

  • Version 1.1.7 - Marketing text improvements
  • Version 1.1.6 - set_discount limits fixes
  • Version 1.1.5 - Added set_cart_discount.
  • Version 1.1.4 - Added set_group, set_min_items, MINPRICE.
  • Version 1.1.3a - Fixes for Google Checkout.
  • Version 1.1.3 - Sort cart by price and discount least expensive items first.
  • Version 1.1.2 - Add protection against double dipping (set_deal_id, set_no_double_dip).
  • Version 1.1.1 - Added promotional page.
  • Version 1.1.0 - Updated for PHP4 compatibility.
  • Version 1.0.0 - First Release.

FAQ

Q: Why is there an Big Spender in the first place?
A: To better facilitate a more powerful model for discounting based on dollars spent than can be done by modifying Quantity Discounts.

Q: Why do you have to add PHP code to setup()? Why didn't you put this in the Admin panel?
A: Although it's a bit tedious to have to manually code the associations, it maximizes the module's flexibility. If you need help with the setup logic, I will be happy to do it for you for a small fee, but first look at the many examples in this page.

Q: Can I start and stop my Big Spender discounts on certain dates?
A: Please see the Timing Discounts for an explanation of how to do this.

Q: I would like my discounts to show up in the shopping cart. Why don't they?
A: The way the Order Total modules work is that they show up at checkout time. However, if you require the discounts to show up in the shopping cart, you may wish to purchase the Discount Preview module for $30.

Alternately, you may indicate that you have a Big Spender discount policy by adding to TEXT_INFORMATION in includes/languages/english/shopping_cart.php, and inform the user that Big Spender discounts will be calculated (and visible) at checkout time. Additionally, changing SUB_TITLE_SUB_TOTAL in the same file to something like 'Sub-Total BEFORE Discount' will emphasize the fact that a discount will be added at checkout time.

Q: How can I present my Big Spender discounts on the product page?
A: Create your custom template if you haven't already done so. Then customize the file

includes/templates/template_default/templates/tpl_product_info_display.php.

Follow the directions in marketing in the installation instructions for details on the changes that are required.

Q: I like the message on my product page, but I'd like it to have a link in it. The threshold for my discount is a $100 hardware purchase, which corresponds to category 1.
A: You can create a link in your message.
         $this->add_threshold(100, 'Spend over $100 on <a href="index.php?main_page=index&cPath=1">hardware</a>, 
                                    get two movies free', false);
This will show up on your product info page as
         'Spend over $100 on hardware, get two movies free'
Be sure to construct your link WITHOUT a zenid. Do not just copy and paste from your address bar!

Q: What is the difference between MINPRICE and PRICE?
A: PRICE means the price must be exactly equal to the specified value. MINPRICE means the price must be greater than or equal to the specified value. So using MINPRICE in a set_constraint means that only items of this price or greater count in the threshold calculation. Using MINPRICE in a set_negative_constraint means that only items below this price are counted. And using MINPRICE in a set_discount() or set_choice_discount() means that items at the specified price or greater will match the rule.

Q: If I specify multiple thresholds with the same discounts, will Big Spender double discount my products?
A: Each product in the customer's cart will only be discounted once by Big Spender. Specifying "repeatable" for a threshold or an item count greater than 1 for set_discount will discount multiple times only if multiple items exist; it will not cause the same item to be discounted multiple times.

Q: I like Big Spender, but I really just want to give cash discounts to my customers. Is this possible?
A: In version 1.1.5, the "set_cart_discount()" command was introduced to allow this.

Q: In what order are the discounts evaluated?
A: The thresholds are evaluated in the order they are entered, with the set_discount() parameters executed first (in the order they were entered), followed by the set_choice_discounts (in the order they were entered). If repeatable is specified, a discount is run as many times as possible (as long as products are not discounted multiple times). If a threshold uses no_double_dip, and other thresholds with the specified ids have already been passed and discounted, that threshold's discounts will not be run.

All discounts are run unless a discount is precluded because of a set_no_double_dip() command. Items are discounted in the order least expensive to most expensive.

Q: OK, I have the Big Spender information on my product page, but my customers can't figure out that the discount isn't visible until checkout time
A: Add some explanatory text to the discountPolicy information you created above. This way it will show up every time there is Big Spender information on a page. Alternately, you may purchase the Discount Preview module, or you may also add text to the shopping cart page to indicate that Big Spender discounts will show up at checkout time as discussed above.

Q: I operate a multilingual shop. How can I avoid putting my descriptions in ot_bigspender_discount.php?
A: If you run a multilingual shop, then instead of putting the string in the add_threshold() command directly, create the file includes/languages/english/extra_definitions/ot_bigspender_defs.php and put your definitions there as PHP defined strings. Here's an example:

<?php
  define('BIGSPENDER_MOVIE_DISCOUNT', "Spend over $200, get a movie half off");
?>
Then, in ot_bigspender_discount.php, do
$this->addthreshold(200, BIGSPENDER_MOVIE_DISCOUNT, false); 


Q: How do I put a link in my supporting text?
A: To put an external link, use
            $this->set_support('<a href="articles/Sample_PDF.pdf">Sample PDF document</a>');
(single quotes around the entire string and double quotes around the href parameter or vice versa.)

For a link to a category (say category 17), use
         $this->set_support('Here is our <a href="index.php?main_page=index&cPath=17">hardware</a> category');


For a link to a product (say product 9), use
    $this->set_support('Here is our  <a href="index.php?main_page=product_info&products_id=9">widget</a> product');


Q: How can I display images? Can I use set_support to display images?
A: Absolutely!
    $this->set_support('<img src="images/my_image.jpeg" />');


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

Q: When I use PROD, it works, but I can't seem to get CAT to work. Why?
A: This is the most common question of all. Please see the Category Issues page for solutions.

Q: All these rules and parameters and combinations make my head hurt. Will you configure this for me?
A: Naturally. Contact me with your requirements for a quote.



  I charge a fee of $60 for Big Spender.


Want more Zen Cart?     Tips and Tricks     Contributions     Extensions     Custom Software     Newsletter

   Terms | Privacy | SiteMap | Newsletter | Contact Me | ©2003-2008 That Software Guy, Inc.