Skip to main content
When a signed-out customer taps a favorite button, they are sent to the Shopify new customer accounts login page. If your store uses classic customer accounts, add one script to your theme to send them to the classic login page (/account/login) instead. After signing in, they return to the page they were on.

Setup

In the theme code editor, open layout/theme.liquid and add the following script just before </body>.
This applies to every favorite button in the app (products, brands, stores, collections, pages, and articles). If “Unauthenticated button behavior” is set to “Show login guidance”, the sign-in button in the guidance goes to the same page.
The script has no effect if you add it before </head>, for example right after {{ content_for_header }}. Always add it just before </body>.

How to check

Sign out, open a product page, and tap the favorite button. If the address bar shows /account/login?return_url=..., the setup is complete.
To return customers to the original page after they sign in, your login page must use Shopify’s standard login form ({% form 'customer_login' %}). If you have customized the login page, check that its source contains an input with name="return_url".