If statement 批发商店-如果声明不起作用
我正在建立一个批发商店,但有多个用户组。第一个用户组If statement 批发商店-如果声明不起作用,if-statement,shopify,liquid,If Statement,Shopify,Liquid,我正在建立一个批发商店,但有多个用户组。第一个用户组rdg00041工作正常,但在elsif部分之后,代码停止工作 {% if template contains 'rdg000141' or template contains 'wholesale' %} {% if customer.tags contains 'rdg000141' and template contains 'rdg000141' %} {{ content_for_layout }} {
rdg00041
工作正常,但在elsif
部分之后,代码停止工作
{% if template contains 'rdg000141' or template contains 'wholesale' %}
{% if customer.tags contains 'rdg000141' and template contains 'rdg000141' %}
{{ content_for_layout }}
{% else %}
{% include 'wholesale-note' %}
{% elsif customer.tags contains 'wholesale' and template contains 'wholesale' %}
{{ content_for_layout }}
{% else %}
{% include 'rdg000141-note' %}
{% endif %}
{% else %}
{{ content_for_layout }}
{% endif %}
{% endif %}
干杯怎么不起作用?请说得更具体一点。我为您修复了缩进,现在您可以看到出了什么问题。在
elsif
之前有else
,这是无效的。在if
块中只能有一个else
,它必须是最后一个分支。这是液体编码器提交给我的修订版本,但仍然无法正常工作,我目前遇到的问题是,一个用户组可以正常工作,例如,批发组受到保护,不受公众的影响,并且工作正常,因此没有用户组标签或公众无法查看产品页面,但是当您切换到rdg组时,即使用户有标签,产品也会被阻止。{%if模板包含“rdg000141”}{%if customer.tags包含“rdg000141”}{{{content_for_layout}}{%else%}{%include”批发票据“}{%endif%}{%elsif模板包含“批发”}{%if customer.tags包含“批发”}{{{content_for_layout}{%else%}{%include'批发便笺'%}{%endif%}{%else%}{{content_for_layout}}{%endif%}@juzraai我已经尝试过你的代码,但是我得到的通知只是批发便笺?我不知道为什么会出现这种情况