I want to redirect non-logged-in users to the registration page when they attempt to make a purchase

Topic summary

A user wants to modify their e-commerce site so that non-logged-in users are redirected to the registration page instead of the login page when attempting to purchase products.

Proposed Solution:

  • Navigate to the “Sections” directory in the code editor
  • Locate and open the “password-protected.liquid” file
  • Search for a specific line of code (appears garbled in the post)
  • Replace it with code containing {% if customer %}

Follow-up Question:
Another user with the Dawn template has the same issue and asks where specifically to insert the code snippet in their theme.

The discussion remains open with the technical implementation details partially unclear due to formatting issues in the posted code.

Summarized with AI on November 17. AI used: claude-sonnet-4-5-20250929.

■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

  1. In the code editor, navigate to the “Sections” directory and locate the “password-protected.liquid” file.

  2. Open the “password-protected.liquid” file and search for the following line of code:


Replace that line with the following code:

```markup
{% if customer %}

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!