Hi, I’ve created a simple one product website using Dawn.
I have 2 product templates, one for retail and one for wholesale.
I’ve managed to include what I need for very basic wholesale requirements without an app.
I’ve added this coding to theme.liquid which restricts access to the wholesale product page unless the customer is logged in and is tagged wholesale.
{% if template contains ‘product’ and request.path == ‘/products/wholesale’ %}
{% if customer and customer.tags contains ‘wholesale’ %}
{% comment %} Continue rendering the wholesale product page for logged-in wholesale customers {% endcomment %}
{% else %}
{% comment %} Redirect non-wholesale customers to the homepage or another page of your choice {% endcomment %}
{% assign redirect_url = ‘/’ %}
{% endif %}
{% endif %}
It works perfectly on the front end to restrict access as intended BUT it’s also preventing me from accessing the product template to edit it. Would appreciate any assistance in what to add to this coding to bypass the restriction to enable editing.
Thanks in advance.