How to calculate totals with smarty php
Posted
by Kyle Sevenoaks
on Stack Overflow
See other posts from Stack Overflow
or by Kyle Sevenoaks
Published on 2010-04-06T07:51:19Z
Indexed on
2010/04/06
7:53 UTC
Read the original article
Hit count: 316
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.
© Stack Overflow or respective owner