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}

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

报告相同问题?

悬赏问题

  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
  • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
  • ¥15 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值