Redirecting customer after sign up

Sreehari
Tourist
13 0 0

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 ?

Reply 1 (1)
AvadaCommerce
Shopify Partner
3342 742 617

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!

 

AVADA - Top Rated App for Email, SMS, Popups


Check our website for full features and start a FREE TRIAL.
Install another app to boost sales, 100% FREE