New Zenner
- Join Date:
- Sep 2008
- Posts:
- 98
- Plugin Contributions:
- 0
Change Shopping Cart Totals to Reflect Discounts
I am trying to come up with a way to have the "totals" shown on the Shopping Cart Sidebox as well as the primary Shopping Cart reflect the total of the items AFTER adjustment for discounts. I have been successful in doing that for the Sidebox...but not for the main Shopping Cart...so I thought I would indicate what I have done in the Sidebox and then see if anyone can direct me how to apply the same thing to the Shopping Cart itself.
In the sidebox I found the following:
if ($_SESSION['cart']->count_contents() > 0) {
$content .= '<hr />';
$content .= '<div class="cartBoxTotal">' . $currencies->format($_SESSION['cart']->show_total()) . '</div>';
$content .= '<br class="clearBoth" />';
Since in my case I am using the quantity discount add-in, I adjusted the language in this section by adding -$qd['total'] in the indicated place below.
if ($_SESSION['cart']->count_contents() > 0) {
$content .= '<hr />';
$content .= '<div class="cartBoxTotal">' . $currencies->format($_SESSION['cart']->show_total()-$qd['total']) . '</div>';
$content .= '<br class="clearBoth" />';
Once I did that, the number that automatically appears at the bottom of the shopping cart sidebox now accurately reflects the total amount AFTER adjusting for the discount.
Having accomplished that, I wanted to go to the main shopping cart and do the same thing. There the total amount appears twice...in the header area and also near the bottom (where it is actually called sub-total)...but I have been unable to figure out how to do the same kind of thing there.
Anyone have any ideas? Thanks.