discount preview

Zen Cart Discount Preview

A Zen Cart™ mod which allows you to display order total discounts on the shopping cart page (and in the shopping cart sidebox, if desired). In this way, discounts which are normally not visible until the second page of checkout are visible earlier.

Works with my Better Together and Quantity Discounts contributions, the built-in Zen Cart Group Discount module, and my Free Gift Chooser, BOGO Discount, Combination Discounts, Big Spender, Big Chooser, Manufacturer Discount, Case Discounts, Table Discounts, and Frequency Discounts extensions.

Relevance: Zen Cart™ 1.3.5 - 1.3.9, 1.5.x. Please specify your Zen Cart version when ordering.

Current Version: 1.10 (for Zen Cart 1.3.9 and 1.5.x)
1.10_subtotal (for Zen Cart 1.3.9 and 1.5.x)
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: $30 ($35 to show the revised subtotal). Buy Now! (Note: this low price covers software only for self-installation.)
Would you like to ask me questions before buying? No problem! Just email your inquiry to . Please be sure to include your cart type and version (e.g. Zen Cart 1.5.1) and the mod you want to buy.

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

Installation Difficulty: Moderate

Installation Instructions: click here

Common Installation Problems: click here

Buy: Buy Discount Preview! Or email your pre-purchase question to .

See it Live: Go to my demo shop and add ten of any item to your cart (excluding gift certificates). You will immediately see the discount because of Discount Preview. Without Discount Preview, the discount would not be visible until the second page of checkout.

Bugs: click here

Incompatibilities: This software will not work with AJAX add-to-cart or checkout mods that do not reload the page when changing the cart contents or checking out. This software will not display a discounted price in the header if you are using a mod to display the shopping cart total in the header. Please do not order this software if you are using these mods.

Screenshots: See Discount Preview in the wild! click here

Overview:

This mod permits customers to preview the order total discounts they will receive from the built-in Group Discount module, as well as from the Better Together and Quantity Discounts contributions and the Free Gift Chooser, Combination Discounts, Big Spender, Big Chooser, BOGO Discount, Manufacturer Discount, Table Discounts, and Case Discounts, and Frequency Discounts extensions. You may preview whatever combinations of discounts is configured for your shop.

Let's look at three example screenshots of the shopping cart page, assuming you have a Better Together Discount of "Buy the keyboard, get the mouse free."

Regular Shopping Cart Page

Cart with no Discount Preview extension installed

Although both the keyboard and the mouse are in the cart, it's not clear to your customer that the mouse is actually free.


Normal Shopping Cart Page

Cart with the Discount Preview extension installed

This is better! It shows the discount prior to them checking out. This way they won't think there's something wrong or they didn't understand the discount.


Shopping Cart Page with the Discount Preview Extension AND revised subtotal

Cart with the Discount Preview extension and revised subtotal installed

Some people prefer this type of layout, where the subtotal is recomputed after the discount. It's your choice.


Shopping Cart Sidebox With Discount Preview Extension

Sidebox with the Discount Preview extension installed


The discounts are shown as line items below the subtotal on the shopping cart page. The summary computation is optional for a small additional fee of $5. Initial versions didn't have it, since these line items are designed to appear the way they will on page two of the checkout, but enough people asked for it that I added it as a feature.

I charge $30 for the basic version of Discount Preview for Zen Cart, and $35 for the version which shows the revised subtotal. This money helps fund the work I do on free software, such as Quantity Discounts and Better Together. Buy Discount Preview!
The fee covers software only; installation is extra if you require help.





Major Versions of Discount Preview with Subtotal

  • 1.10_subtotal 05/01/13 Added Case Discounts, Free Gift Chooser.
  • 1.3.9_9_subtotal 09/01/12 Added BOGO Discount.
  • 1.3.9_8_subtotal 04/29/11 Added Manufacturer Discount.
  • 1.3.8_8_subtotal 04/29/11 Added Manufacturer Discount.
  • 1.3.9_7_subtotal 09/05/10 Fixed Account History Info page
  • 1.3.8_7_subtotal 09/05/10 Fixed account history info page issue
  • 1.3.9_6_subtotal 04/25/10 Upgraded for 1.3.9
  • 1.3.8_6_subtotal 04/02/10 Added Table Discounts
  • 1.3.8_5_subtotal 11/30/09 Added Frequency Discount
  • 1.3.8_4_subtotal 10/07/08 Did not get group discount fix in 1.3.8_2
  • 1.3.8_3_subtotal 09/27/08 Bugs in Big Spender, Big Chooser in subtotal
  • 1.3.8_2_subtotal 05/13/08 fix to group discount issue
  • 1.3.8_1_subtotal 01/31/08 Subtotal added in
  • 1.3.8_1 12/24/2007 - Upgrade to 1.3.8
  • 1.3 12/07/2007 - Added Big Chooser
  • 1.2 08/26/2007 - Added Big Spender
  • 1.1 04/07/2007 - Added Combination Discounts
  • 1.0 10/25/2006 - First Release for 1.3.7

Major Versions of Discount Preview

  • 1.10 05/01/13 Added Case Discounts, Free Gift Chooser.
  • 1.3.9_9 09/01/12 Added BOGO Discount.
  • 1.3.9_8 04/29/11 Added Manufacturer Discount.
  • 1.3.8_8 04/29/11 Added Manufacturer Discount.
  • 1.3.9_7 09/05/10 Fixed Account History Info page
  • 1.3.8_7 09/05/10 Fixed account history info page issue
  • 1.3.9_6 04/25/10 Upgraded for 1.3.9
  • 1.3.8_6 04/02/10 Added Table Discounts
  • 1.3.8_5 11/30/09 Added Frequency Discount
  • 1.3.8_4 10/07/08 Did not get group discount fix in 1.3.8_2
  • 1.3.8_3 09/27/08 Bugs in Big Spender, Big Chooser in subtotal
  • 1.3.8_2 05/13/08 fix to group discount issue in 1.3.8
  • 1.3.8_1 12/24/2007 - Upgrade to 1.3.8
  • 1.3 12/07/2007 - Added Big Chooser
  • 1.2 08/26/2007 - Added Big Spender
  • 1.1 04/07/2007 - Added Combination Discounts
  • 1.0 10/25/2006 - First Release for 1.3.7

Bugs

  • All versions, releases prior to Sept. 2010: if you use the shopping cart sidebox, you MUST make this change.
    Edit the file includes/templates/YOUR-TEMPLATE-NAME/sideboxes/tpl_shopping_cart.php Modify the line
         if ($current_page_base != "shopping_cart") 
    
    to say
         if (($current_page_base != "shopping_cart") &&
             ($current_page_base != "account_history_info"))
    
    This just turns off the discount preview logic on the account history info page.
  • If you are running Zen Cart 1.3.8 and you are using Group Pricing, please make the following fix if your version of Discount Preview doesn't have it:
    edit the file includes/modules/<your template>/inc_gp.php, and change
         $gp = $discount->calculate_deductions($ot);
    
    to
         $gp = $discount->calculate_deductions($ot['total']);
    
    This fix applies to Zen Cart 1.3.8 ONLY.

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. If you use the Shipping Estimator feature to display an estimate of shipping costs in the cart, you MUST change the file includes/modules/shipping_estimator.php. Look for a line that says
           require(DIR_WS_CLASSES . 'order.php');
    
    and change this to
           require_once(DIR_WS_CLASSES . 'order.php');
    
  4. If you have also ordered Checkout Candy or Checkout Candy for Combination Discounts from me, you will have to merge the files ./includes/templates/custom/templates/tpl_shopping_cart_default.php
    ./includes/templates/custom/css/shopping_cart.css
  5. The shopping cart sidebox will not display the discount information when the shopping cart page is being displayed. If you use the shopping cart sidebox, you must configure your cart not to displayed this sidebox on the shopping cart page. Go to Admin->Configuration->Layout Settings->Shopping Cart Box Status, and set this value to 2.

Installation Problems:

The most common installation problems for this module are as follows:
  1. Forgetting to copy the files from includes/modules/customto includes/modules/YOUR_TEMPLATE if your template is not named "custom"
  2. If you see the message that looks something like, "Fatal error: Cannot redeclare class order in /var/www/web4/web/includes/classes/order.php on line 20", you need to look for statements that do
    require(DIR_WS_CLASSES . 'order.php');
    
    and change them to
    require_once(DIR_WS_CLASSES . 'order.php');
    
    This must be done in the following places:
    • includes/modules/shipping_estimator.php
    • includes/modules/payment/paypalwpp.php (if you are using PayPal Website Payments Pro).
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.

Tips

  • If you've never installed a Zen Cart mod before, please read my Guide to Mod Installation on Zen Cart.
  • IMPORTANT! If you are using Quantity Discounts, and you're using the marketing suggestions on the product info page, please be sure you have the latest code:
    <?php
      $value = "ot_quantity_discount.php"; 
      include_once(zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . 
              '/modules/order_total/', $value, 'false'));
      include_once(DIR_WS_MODULES . "order_total/" . $value);
      $discount = new ot_quantity_discount();
      echo '<div class="content" id="discountPolicy">'; 
      echo '<h2>' . STORE_POLICY . '</h2>'; 
      echo $discount->get_html_policy();
      echo '<br /></div>'; 
    ?>
    
    (i.e. both "include" statements should be "include_once")
  • To place a message at the top of the shopping cart page near the undiscounted total, edit the file customize the file includes/languages/english/shopping_cart.php, and set TEXT_INFORMATION to something like "See bottom of page for discount information."
  • If you use the shopping cart sidebox, you should define the following new CSS class in includes/templates/custom/css/stylesheet.css
    .cartBoxDiscount {
            text-align: right;
            font-weight: bold;
            }
    
    This is how your discount information will appear in the shopping_cart sidebox.
  • If you have any problems after installing this mod, the first thing you should do is delete includes/templates/custom/sideboxes/tpl_shopping_cart.php Although this works well with a freshly installed cart, it is possible that the logic in this file will not interoperate with other modifications you have made. You may need to turn off the shopping cart sidebox or simply use some text in here telling the customer to go to the shopping cart page to see discount information. The next tip describes how to do this.
  • If you are using the shopping cart sidebox but would prefer not to indicate the amount of the discount (or have interoperability problems as described above), customize the file includes/templates/template_default/sideboxes/tpl_shopping_cart.php, copying it to includes/templates/custom/sideboxes/tpl_shopping_cart.php. At the bottom of the file, right before the line
       $content .= '</div>';
    
    insert the line
       $content .= CART_INFORMATION_SIDEBOX;
    
    If you have used CSS styling in the main page of shopping_cart.php, you can make the sidebox look the same by using this line instead:
       $content .= '<div id="cartInstructionsDisplay" class="content">';
       $content .= CART_INFORMATION_SIDEBOX; 
       $content .= '</div>';
    
    CART_INFORMATION_SIDEBOX is a string you have defined in includes/languages/english/extra_definitions/discount_preview.php like this:
    define('CART_INFORMATION_SIDEBOX','Discounts displayed in shopping cart');
    

  • Want to show off your discounts even more using red lettering, yellow background or some other effect? See my Highlighting your Discounts tip.

Showing the revised subtotal

Want see the subtotal after discounts? Some people like this and others don't, so I make it optional. Just ask if you want it. subtotal screenshot


I charge $30 for the basic version of Discount Preview for Zen Cart, and $35 for the version which shows the revised subtotal. Buy Discount Preview!
The fee covers software only; installation is extra if you require help.