Velvet Star Monitor

Standout celebrity highlights with iconic style.

updates

How to auto login after registration in shopify dawn theme?

Writer Olivia Zamora

I have a website on shopify. How to auto login after registration in shopify dawn theme?

1 Answer

By default, new customers are auto login to the account page after they register a new account. Kindly follow the below steps to auto-login the customer to a specific page when they register a new account. edit your theme layout/theme.liquid file and add this script before the end of the body tag. and change "REDIRECT_PATH".

 <script> (function() { var REDIRECT_PATH = '/account'; // change page url you want redirect after login var selector = '#create_customer, form[action$="/account"][method="post"]', $form = document.querySelectorAll(selector)[0]; if ($form) { $redirect = document.createElement('input'); $redirect.setAttribute('name', 'return_to'); $redirect.setAttribute('type', 'hidden'); $redirect.value = REDIRECT_PATH; $form.appendChild($redirect); } })(); </script>

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy