Why is my customer redirection not working post sign up?

Redirect To Home After Logging In Not Working On Dawn 2.0

Hi Can someone help me to set this up. Currently when someone creates an account it does not redirect customer after verification of e-mail. Can someone help me ?

Hi @Sreehari

Hope you are doing great!

To redirect customer after sign up, please place this in script tags at the bottom of your registration form liquid page. As far as I know, It’s the only way that Shopify allows it:

jQuery(function() {
jQuery('#create_customer').submit(function(event) {
  event.preventDefault();
  var data = jQuery(this).serialize();

 //create new account
  jQuery.post('/account', data)
    .done(function(data){
    var logErrors = jQuery(data).find('.errors').text();

    //if there are errors show them in the html form
    if (logErrors != "" && logErrors != 'undefined'){
        jQuery('#create_customer .errors').html(logErrors);
        jQuery('#create_customer .errors').show();

    //if account creation is successful show checkout page
    }else{
       console.log('success');
      document.location.href = '/checkout';
    }
    }).fail(function(){console.log('error');});
   return false;
}); 
});

If you feel like my answer is helpful, please mark it as a SOLUTION. Let me know if you have any questions!

By default, when someone registers for an account they will be logged in and redirected to the Customer Account page (/account). You can use a script to redirect. Here’s a blog we wrote about that.

If you’re looking for a no-code solution, the Customer Fields app allows you to easily set a redirect path after a customer signs up for an account.