Discount Preview for osCommerce
A osCommerce™ mod which allows you to
display the
Better Together and
Quantity 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.
Discount Preview also displays the
Big Spender,
Big Chooser and
Table Discounts
discounts on the shopping cart page.
Relevance: osCommerce ™ 2.2 and 2.3
This extension is part of the
Better Together World.
Cost: $30
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: osCommerce 2.2
and
osCommerce 2.3
Support Thread: My commercial software is not supported on the osCommerce forum. Please email me questions instead.
See it Live: Go to
my demo shop and add ten of any item to your cart.
You will immediately see the discount because of
Discount Preview. Without
Discount Preview, the discount would not be visible until the
Order Confirmation Page.
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 the
Better Together and
Quantity Discounts contributions
and the
Big Spender for osCommerce,
Big 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 2.2 Shopping Cart Page With the Discount Preview Extension
osCommerce 2.3 Shopping Cart Page With the Discount Preview Extension
osCommerce 2.2 Shopping Cart box With Discount Preview Extension
osCommerce 2.3 Shopping Cart box With Discount Preview Extension
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.
- 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. All the files are new.
- 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");
?>
- 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');
}
-
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.
- 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.
- 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.
- 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. All the files are new.
- 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");
?>
-
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>';
-
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.
- 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.
- 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;
|
|
I charge a fee of $30 for Discount Preview for osCommerce.
The fee covers software only; installation is extra if you require help.
|