在shopify中隐藏来自未登录客户的文本

问题描述 投票:1回答:1

我一直在使用:

{% if customer %}  
    Add to cart code goes here 
{% endif %}

要隐藏非客户的购物车按钮,但有没有代码可以隐藏客户的东西?我想向非客户显示链接以便注册,但我不希望客户在登录后看到该链接。

谢谢,迈克

shopify
1个回答
0
投票

只要使用if else

{% if customer  %}
<a href="/account">Your Account</a>
{% else %}
{{ 'Log in' | customer_login_link }}
{% endif %}
© www.soinside.com 2019 - 2024. All rights reserved.