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.
Relevance: Zen Cart™ 1.3.5 - 1.3.9, 1.5.0. Please specify your Zen Cart version when ordering.
Current Version:
1.3.9_8 (for Zen Cart 1.3.9 and 1.5.0), 1.3.8_8 (for Zen Cart 1.3.8),
1.3.9_8_subtotal (for Zen Cart 1.3.9 and 1.5.0), 1.3.8_8_subtotal (for Zen Cart 1.3.8).
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.
Cost: $30 ($35 to show the revised subtotal).
Buy Now!
(Note: this low price covers software only for self-installation.)
Installed Cost: $90.00
(Professional installation by That Software Guy)
Installation Difficulty: Moderate
Installation Instructions: click here
Common Installation Problems: click here
Support Thread: My commercial software is not supported on the Zen Cart forum. Please email me questions instead.
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.
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
Combination Discounts,
Manufacturer Discount, and
Big Spender,
Big Chooser,
Manufacturer Discount,
Table Discounts, and
Frequency Discounts
extensions.
You may preview whatever combinations of discounts is configured
for your shop.
Shopping Cart Page With the Discount Preview Extension
Shopping Cart Sidebox With Discount Preview Extension
Ordinary Shopping Cart Page
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.
|
Major Versions of Discount Preview with Subtotal
- 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.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:
- Back up everything! Try this in a test environment prior to installing
it on a live shop.
- 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.
- 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');
- 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
Installation Problems:
The most common installation problems for this module are as follows:
- Forgetting to copy the files from includes/modules/custom to includes/modules/YOUR_TEMPLATE if your template is not named "custom"
- 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');
- 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, my recommendation is
to run with it not displayed on the shopping cart page.
Use Admin->Configuration->Layout Settings->Shopping Cart Box Status, and set this value to 2.
- 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.
|
|
I charge $30 for the basic version of Discount Preview for Zen Cart,
and $35 for the version which shows the revised subtotal.
The fee covers software only; installation is extra if you require help.
|
Want more Zen Cart?
Tips and Tricks
Contributions
Extensions
Custom Software
Newsletter