【发布时间】:2015-05-27 21:26:17
【问题描述】:
我想让 shopify 上的模板仅对管理员可见。 我可以让它只对客户可见,但现在只需要管理员代码。
我使用的客户代码是:
{% unless customer %}
{% if template contains 'customer' %}
{% assign send_to_login = false %}
{% else %}
{% assign send_to_login = true %}
{% endif %}
{% endunless %}
{% if send_to_login %}
<meta content="0; url=/account/login?checkout_url={{ shop.url }}" http-equiv="refresh" />
{% else %}
==== Page Content ===
{% endif %}
//The code above asks to the user to login if they visit this template
现在可以为管理员制作类似的东西吗?管理实体的名称是什么?例如,这里的实体客户是“客户”。我应该如何在代码中声明管理员? 提前致谢。
【问题讨论】:
标签: javascript php web-applications shopify