Skip to content

Instantly share code, notes, and snippets.

@svaustin66
Created December 5, 2021 23:58
Show Gist options
  • Save svaustin66/3166452b1f8f4a182d18a1f2f995934d to your computer and use it in GitHub Desktop.
Save svaustin66/3166452b1f8f4a182d18a1f2f995934d to your computer and use it in GitHub Desktop.
Restrict access by page to certain parts of a Shopify store
<html lang="{{ shop.locale }}">
{% if template contains "subscription" %}
<!-- Subscription Content -->
{% unless customer %}
{% assign send_to_login = true %}
{% endunless %}
{% endif %}
{% if send_to_login and request.path != "/challenge" %}
<!-- Need to login -->
<meta content="0; url=/account/login?checkout_url={{ request.path }}" http-equiv="refresh" />
{% else %}
<head> </head>
<body> </body>
{% endif %}
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment