- This topic has 0 replies, 1 voice, and was last updated 14 years, 5 months ago by .
Viewing 1 post (of 1 total)
Viewing 1 post (of 1 total)
- You must be logged in to reply to this topic.
Support site for Tips and Tricks HQ premium products
by
Tips and Tricks HQ Support Portal › Forums › Simple PayPal Shopping Cart › Simple Shopping Cart Tweaks › Calculating the sub total and the total quanity for the simple shopping cart
Tagged: calculate sub total
You can use the following bit of code to calculate the sub total and the quantity and use it anywhere on your theme:
foreach ($_SESSION['simpleCart'] as $item)
{
$sub_total += $item['price'] * $item['quantity'];
$total_items += $item['quantity'];
}
echo "Sub Total: ".$sub_total ;
echo "<br />Total Items: ".$total_items;