【问题标题】:Prestashop: issue with conditional statements in tpl file (PHP, Smarty)Prestashop:tpl 文件中的条件语句问题(PHP,Smarty)
【发布时间】:2020-09-03 19:07:01
【问题描述】:

我正在努力实现这一目标:

  • 在订单确认页面显示有条件的凭证。
  • 凭证与两个必要条件有关:订单的 体重以及用户是否有帐号

所以我正在使用以下文件:/public_html/themes/mytheme/templates/checkout/order-confirmation.tpl。到目前为止我已经尝试过了:

{if ($order.shipping_weight >= 1.00) && ($logged)}
    <div class="5-percent-voucher">Voucher</div>
{elseif ($order.shipping_weight >= 2.00) && ($logged)}
    <div class="10-percent-voucher">Voucher</div>
{else}
{/if}

好消息是页面没有崩溃。坏消息是,当我模拟满足条件的结帐时,什么都没有显示。

有谁知道我在这里做错了什么?提前非常感谢

【问题讨论】:

    标签: php html prestashop smarty


    【解决方案1】:

    这是因为在 1.7 中你没有$logged,你需要使用$customer.is_logged :)

    【讨论】:

    • 嗨,克里斯蒂安!谢谢您的答复。你的评论对我来说很好!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-26
    • 2022-06-16
    • 2015-09-02
    • 2011-04-07
    • 1970-01-01
    相关资源
    最近更新 更多