Liquid, JavaScript, themes, sales channels
■Achieve the desired outcome.
When users attempt to purchase a product, I believe non-logged-in users are directed to the login page. I want to change this so that non-logged-in users are redirected to the registration page instead.
■Theme
Taste4.0.1
In the code editor, navigate to the "Sections" directory and locate the "password-protected.liquid" file.
Open the "password-protected.liquid" file and search for the following line of code:
<form method="post" action="{{ form_action }}">
Replace that line with the following code:
{% if customer %}
<form method="post" action="{{ form_action }}">
{% else %}
{% assign register_url = '/account/register' %}
<form method="post" action="{{ register_url }}">
{% endif %}
We have the same issue but are using the Dawn template. Where in that theme would we insert the code snippet? Thank you for your help!
User | RANK |
---|---|
38 | |
29 | |
13 | |
12 | |
9 |
On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...
By Skye Nov 8, 2023The year-end shopping season is just around the corner. Is a flash sale on your radar? Are...
By Jasonh Nov 6, 2023