Problem:
When a customer login to his account he redirects to the “My Account” page that looks like a blank page. We’ve had a few test customers bring this to our attention. Ideally we would like it to go to our collection or home page if possible.
Question:
How to redirect Shopify customer to specific page instead of 'My account' page after login?
Solution:
Open "wholesale-all-in-one.liquid" file from Snippets section and add following script at the end of file.
The home page is the default redirect page after login in the script bellow, You can change it to any specific page. Examples:
For home page : value="/"
For all products page : value="/collections/all"
<script>
var form = document.querySelectorAll('[action="/account/login"]');
for (var i = 0; i < form.length; i++) {
form[i].innerHTML += '<input type="hidden" name="return_to" value="/">';
}
</script>