douye7033 2010-04-27 08:48
浏览 37
已采纳

Smarty / PHP循环未传递给IE(Pc)或Chrome / FF(Mac)

I've been working on a site that has a lot of PHP/Smarty involved, I've been asked to re-skin a webstore checkout process, but during this we've discovered this issue. This particular quirk is one part of a tax calculation that doesn't get sent to the browser in IE for PC and Chrome/FF for the Mac. It's NOT in the output source in the browsers, but is in FF, Chrome and Opera on the PC.

Here is the code that doesn't "work:"

{foreach $cart.taxes.$currency as $tax}
    <div id="subTotalCaption2"><p style="width:100px;">{$tax.name_lang}:</p></div>
        <div id="taxAmount2"><p>{$tax.formattedAmount}</p></div>
{/foreach}

It's not a CSS issue as if you go all the way through the checkout process and then back to the order page (Not using the back button, using the on-site links) it works. There is another calculation on the last page of the process that does the same thing:

{foreach from=$order.taxes.$currency item="tax"}
        <tr>
            <td colspan="{$colspan}" class="tax">{$tax.name_lang}:</td>
            <td>{$tax.formattedAmount}</td>
        </tr>
    {/foreach}

I guess my question is what could cause this to not be read (Parsed?) in IE and the mac but other browsers do it fine on the PC.

The System installed on the site is the Livecart system (if anyone is familiar with that, I doubt it though), developed in Lithuania I think. If anyone has heard of that. I'm not so sure it's that stable, all I've done is made some CSS/Layout changes and then this entire function disappears.

The site is euroworker.no. You'll have to add an item into the basket (Kjøp and handlevogn).

Thanks.

  • 写回答

1条回答 默认 最新

  • dongtao6842 2010-05-14 11:39
    关注

    Try changing {foreach $cart.taxes.$currency as $tax} with {foreach from=$cart.taxes.$currency item=tax}

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
  • ¥20 Java-Oj-桌布的计算
  • ¥15 powerbuilder中的datawindow数据整合到新的DataWindow
  • ¥20 有人知道这种图怎么画吗?
  • ¥15 pyqt6如何引用qrc文件加载里面的的资源
  • ¥15 安卓JNI项目使用lua上的问题
  • ¥20 RL+GNN解决人员排班问题时梯度消失
  • ¥60 要数控稳压电源测试数据
  • ¥15 能帮我写下这个编程吗
  • ¥15 ikuai客户端l2tp协议链接报终止15信号和无法将p.p.p6转换为我的l2tp线路