1
我想爲Shopify製作一個模板,只有管理員才能看到。 我只能讓客戶看到它,但現在只需要管理員的代碼。模板腳本,使其僅供管理員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
現在是有可能使類似這樣只對管理員的東西嗎?管理實體的名稱是什麼?這裏例如實體客戶是'客戶'。我應該如何在代碼中聲明管理員? 在此先感謝。
It worked :) 非常感謝 –