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

osCommerce Discount Preview

Discount Preview for osCommerce

A osCommerce™ mod which allows you to display my Better Together, Quantity Discounts, Big Spender, Big Chooser, Free Gift Chooser, and Table Discounts order total discounts on the shopping cart page (and in the shopping cart box, if desired). In this way, discounts which are normally not visible until the Order Confirmation page are visible earlier.

Important Version Information: This product is for osCommerce 2.2, 2.3 or 3.0. If you are looking for osCommerce Phoenix, please see the link in the Relevance section below.

Relevance: osCommerce ™ 2.2 and 2.3

If you are looking for osCommerce Phoenix, please see the Discount Preview for Phoenix page.

Current Version: 1.3 (for osCommerce 2.2 and 2.3)
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 osCommerce forum. Please email me questions instead.

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

Installation Difficulty: Moderate

Installation Instructions: osCommerce 2.2 and osCommerce 2.3

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

See it Live: You can see this in the Discount Preview Video:




Zen Cart User? This is an osCommerce page. Look at the Better Together for Zen Cart World for Zen Cart help.


Overview:

This mod permits customers to preview the order total discounts they will receive from my Better Together for osCommerce and Quantity Discounts for osCommerce contributions and my Big Spender for osCommerce, Big Chooser for osCommerce, Free Gift Chooser for osCommerce, and Table Discounts for osCommerce extensions. You may preview whatever combinations of discounts is configured for your shop.

Ordinary Shopping Cart Page

osCommerce Cart without the Discount Preview extension installed


osCommerce 2.2 Shopping Cart Page With the Discount Preview Extension

osCommerce 2.2 Cart with the Discount Preview extension installed

osCommerce 2.3 Shopping Cart Page With the Discount Preview Extension

osCommerce 2.3 Cart with the Discount Preview extension installed

osCommerce 2.2 Shopping Cart box With Discount Preview Extension

osCommerce 2.2 Box with the Discount Preview extension installed

osCommerce 2.3 Shopping Cart box With Discount Preview Extension

osCommerce 2.3 Box with the Discount Preview extension installed


The discounts are shown as line items below the subtotal on the Shopping Cart page, and in the Shopping Cart box (when not on the Shopping Cart page). Note that on the Shopping Cart page, the box appears as before, since the preview is shown in the main body of the page.

Installation Instructions for osCommerce 2.2

These are instructions for osCommerce 2.2.
For osCommerce 2.3, please click here.

  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. All the files are new.
  3. Edit the file catalog/shopping_cart.php, and find the line that prints SUB_TITLE_SUB_TOTAL. Change the <p> and </p> to <div> and </div>, and add the lines
    <?php
      require("discount_preview.php"); 
    ?>
    

    So your catalog/shopping_cart.php file will look like this: ...
          <tr>
            <td align="right" class="main"><b><?php echo SUB_TITLE_SUB_TOTAL; ?> 
                <?php echo $currencies->format($cart->show_total()); ?></b></td>
          </tr>
    <?php
      require("discount_preview.php"); 
    ?>
    
  4. Edit the file catalog/includes/boxes/shopping_cart.php Just before the close of the block that prints the subtotal, add
        require_once('discount_preview.php'); 
    

    So your catalog/includes/boxes/shopping_cart.php file will look like this:
      if ($cart->count_contents() > 0) {
        $info_box_contents[] = array('text' => tep_draw_separator());
        $info_box_contents[] = array('align' => 'right',
                                     'text' => $currencies->format($cart->show_total()));
        require_once('discount_preview.php'); 
      }
    
  5. Because the shopping cart box cannot show the discount on the shopping cart page, I recommend not displaying the shopping cart box on the shopping cart page. At the top of catalog/includes/boxes/shopping_cart.php, add
    <?php
       if ($current_page != FILENAME_SHOPPING_CART) {
    ?>
    
    with a closing
    <?php
       } 
    ?>
    
    at the end of the file.
  6. If you don't display prices with tax included, you're done! Test it out by adding some items to a cart and looking at the shopping cart page.
  7. If you display taxes with price included, please read carefully: Add enough items to your cart to trigger a discount and look at the shopping cart page. The discount is displayed ex VAT. If you don't like this, go to catalog/discount_preview.php and change the line
       $use_vat_display = false; 
    
    to
       $use_vat_display = true; 
    

Installation Instructions for osCommerce 2.3

These are instructions for osCommerce 2.3.
For osCommerce 2.2, please click here.

  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. All the files are new.
  3. Edit the file catalog/shopping_cart.php, and find the line that prints SUB_TITLE_SUB_TOTAL. Change the <p> and </p> to <div> and </div>, and add the lines
    <?php
      require("discount_preview.php"); 
    ?>
    

    So your catalog/shopping_cart.php file will look like this: ...
        <div align="right"><strong><?php echo SUB_TITLE_SUB_TOTAL; ?> 
        <?php echo $currencies->format($cart->show_total()); ?></strong></div>
    <?php
      require("discount_preview.php"); 
    ?>
    
    
  4. Edit the file catalog/includes/modules/boxes/bm_shopping_cart.php Search for the string that prints $cart->show_total(). This line also ends the table. Remove the HTML table close, and insert the lines
            require_once(DIR_FS_CATALOG . 'discount_preview.php');
            $cart_contents_string .=  '</table>';
    
    So before, the line looked like this:
            $cart_contents_string .= '<tr><td colspan="2" style="padding-top: 5px; padding-bottom: 2px;">' . 
                  tep_draw_separator() . '</td></tr>' . 
                  '<tr><td colspan="2" align="right">' . $currencies->format($cart->show_total()) . '</td></tr></table>'; 
    
    Now it looks like this:
            $cart_contents_string .= '<tr><td colspan="2" style="padding-top: 5px; padding-bottom: 2px;">' . 
                  tep_draw_separator() . '</td></tr>' .
                  '<tr><td colspan="2" align="right">' . $currencies->format($cart->show_total()) . '</td></tr>'; 
            require_once(DIR_FS_CATALOG . 'discount_preview.php');
            $cart_contents_string .=  '</table>';
    
  5. The shopping cart box cannot show the discount on the shopping cart page, the checkout confirmation page or the account history info page. You should turn it off on these pages. At the top the function execute() in catalog/includes/modules/boxes/bm_shopping_cart.php, add
          global $PHP_SELF;
          $current_page = basename($PHP_SELF); 
          if ($current_page == FILENAME_SHOPPING_CART) return; 
          if ($current_page == FILENAME_ACCOUNT_HISTORY_INFO) return; 
          if ($current_page == FILENAME_CHECKOUT_CONFIRMATION) return; 
    
    at the end of the file.
  6. If you don't display prices with tax included, you're done! Test it out by adding some items to a cart and looking at the shopping cart page.
  7. If you display taxes with price included, please read carefully: Add enough items to your cart to trigger a discount and look at the shopping cart page. The discount is displayed ex VAT. If you don't like this, go to catalog/discount_preview.php and change the line
       $use_vat_display = false; 
    
    to
       $use_vat_display = true; 
    

Major Versions of Discount Preview for osCommerce 2.3

  • 1.3 06/01/2014 - Added Free Gift Chooser
  • 1.2.1 10/06/2011 - Notes on VAT style display in ./catalog/discount_preview.php
  • 1.2 10/01/2011 - Added Table Discounts
  • 1.1 02/19/2011 - Updates for osc 2.3 (from osC 2.2)

Major Versions of Discount Preview for osCommerce 2.2

  • 1.3 06/01/2014 - Updated for Free Gift Chooser.
  • 1.2.1 10/06/2011 - Notes on VAT style display in ./catalog/discount_preview.php
  • 1.2 10/01/2011 - Updated for Table Discounts
  • 1.1 11/18/2009 - Updated for Big Chooser and Big Spender
  • 1.0 05/17/2009 - First Release
I charge a fee of $30 for Discount Preview for osCommerce. The fee covers software only; installation is extra if you require help. Buy Discount Preview!
The fee covers software only; installation is extra if you require help.