我在结账时有一个“折扣前价格”的清单,我想在底部的新div中计算这些总额。任何想法?如何用smarty php计算总计
我想什么来计算:
{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>
以及如何我试图计算它:
{foreach $item.Product.formattedListPrice.$currency as $savedtotal}
<div id="savedtotals"> {$savedtotal.formattedAmount.$currency}</div>
{/foreach}
感谢。
模板用来显示数据,不计算。所有计算必须在业务逻辑部分完成。 – 2010-04-06 07:59:08
谢谢,那么我需要找出如何到达业务逻辑部分,以及如何做到这一点。 – Kyle 2010-04-06 08:01:40