To do main shopping cart display:
- Edit includes/modules/pages/shopping_cart/header_php.php
Look for the following lines (they were at line 129 on mine):
$productsPrice = zen_get_products_display_price($products[$i]['id'], $products[$i]['quantity']) . ($products[$i]['onetime_charges'] != 0 ? '<br />' . $currencies->display_price($products[$i]['onetime_charges'], zen_get_tax_rate($products[$i]['tax_class_id']), 1) : '');
$productsPriceEach = zen_get_products_display_price($products[$i]['id'], 1). ($products[$i]['onetime_charges'] != 0 ? '<br />' . $currencies->display_price($products[$i]['onetime_charges'], zen_get_tax_rate($products[$i]['tax_class_id']), 1) : '');
Replace those two lines with the following (I copied and commented them out).
// $productsPrice = $currencies->display_price($products[$i]['final_price'], zen_get_tax_rate($products[$i]['tax_class_id']), $products[$i]['quantity']) . ($products[$i]['onetime_charges'] != 0 ? '<br />' . $currencies->display_price($products[$i]['onetime_charges'], zen_get_tax_rate($products[$i]['tax_class_id']), 1) : '');
$productsPrice = zen_get_products_display_price($products[$i]['id'], $products[$i]['quantity']) . ($products[$i]['onetime_charges'] != 0 ? '<br />' . $currencies->display_price($products[$i]['onetime_charges'], zen_get_tax_rate($products[$i]['tax_class_id']), 1) : '');
// $productsPriceEach = $currencies->display_price($products[$i]['final_price'], zen_get_tax_rate($products[$i]['tax_class_id']), 1) . ($products[$i]['onetime_charges'] != 0 ? '<br />' . $currencies->display_price($products[$i]['onetime_charges'], zen_get_tax_rate($products[$i]['tax_class_id']), 1) : '');
$productsPriceEach = zen_get_products_display_price($products[$i]['id'], 1). ($products[$i]['onetime_charges'] != 0 ? '<br />' . $currencies->display_price($products[$i]['onetime_charges'], zen_get_tax_rate($products[$i]['tax_class_id']), 1) : '');
- Back to the zen_get_products_display_price function in includes/functions/functions_prices.php. First we need to extend the functions parameters to include a quantity. Find the function declaration (it's on line 149 on mine)- it looks like:
function zen_get_products_display_price($products_id) {
change to:
function zen_get_products_display_price($products_id,$quantity=1) {
- Within the same function change the following lines (at line 196 on mine):
$display_normal_price = zen_get_products_base_price($products_id);
$display_special_price = zen_get_products_special_price($products_id, true);
$display_sale_price = zen_get_products_special_price($products_id, false);
so that they now multiply the price by the quantity:
$display_normal_price = zen_get_products_base_price($products_id)*$quantity;
$display_special_price = zen_get_products_special_price($products_id, true)*$quantity;
$display_sale_price = zen_get_products_special_price($products_id, false)*$quantity;
- Finally we need to do the subtotal box at the bottom of the cart. This means quite a large overhaul of the shoppingCart class in includes/classes/shopping_cart.php. If you've not made any changes to this then probably the best thing is to replace the entire file with the version in the zip file (all the other changed files are there too). Otherwise all my changes are tagged !!! AGM.
Now edit your custom tpl_shopping_cart_default.php (in includes/templates/YOUR CUSTOM FOLDER/templates). Find the line that reads:
<div id="cartSubTotal"><?php echo SUB_TITLE_SUB_TOTAL; ?> <?php echo $cartShowTotal; ?></div>
and completely replace with the following:
<div id="cartSubTotal">
<?php
echo SUB_TITLE_SUB_TOTAL.' ';
echo $cartShowTotal;
if(DISPLAY_PRICE_WITH_TAX=='2')
{
echo '<span class="productTaxExTag"> '.PRICE_EX_TAX_TEXT.'</span>';
echo $cartShowTotalIncTax;
echo '<span class="productTaxIncTag"> '.PRICE_INC_TAX_TEXT.'</span>';
}
?>
</div>
Andrew
Andrew Moore
Omnicia Agile Development
www.omnicia.com