How to calculate totals with smarty php
- by Kyle Sevenoaks
Hi, I have a list of "before discount" prices on my checkout, I want to calculate the total amount of these in a new div at the bottom.. Any ideas?
What I want to calculate:
{if $item.Product.formattedListPrice}
<div id="salg" title="Rabatt"></div>
{/if}
<div id="cart2Salg">
{if $item.Product.formattedListPrice}
<span class="listPrice" title="Opprinnelige prisen">
{$item.Product.formattedListPrice.$currency}
</span>
{else}
<span class="listPrice">
</span>
{/if}
</div>
And how I tried to calculate it:
{foreach $item.Product.formattedListPrice.$currency as $savedtotal}
<div id="savedtotals"> {$savedtotal.formattedAmount.$currency}</div>
{/foreach}
Thanks.