我一直在使用:
{% if customer %}
Add to cart code goes here
{% endif %}
要隐藏非客户的购物车按钮,但有没有代码可以隐藏客户的信息?我想向非客户显示链接以便注册,但我不希望客户在登录后看到该链接。
谢谢, 麦克
答案 0 :(得分:0)
只要使用if else
{% if customer %}
<a href="/account">Your Account</a>
{% else %}
{{ 'Log in' | customer_login_link }}
{% endif %}