gpt4 book ai didi

javascript - 模板脚本使其仅对 Shopify 上的管理员可见

转载 作者:行者123 更新时间:2023-11-28 07:19:16 26 4
gpt4 key购买 nike

我想在 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

现在是否可以为管理员制作类似的东西?管理实体的名称是什么?例如,这里的实体客户是“客户”。我应该如何在代码中声明管理员?提前致谢。

最佳答案

查看这些类似的问题:

目前没有像检查客户那样检查管理员的好方法。您的选择是tag your customers as admins仅当客户具有管理员标签或 check against the customer's email address 时才显示您的模板以确定他们是否是管理员。

关于javascript - 模板脚本使其仅对 Shopify 上的管理员可见,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30493444/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com