3

When a user places an order, then click to checkout, then has to choose to create an account...after he or she submits the form it redirects to account dashboard page (even i chose in settings of magento not to do it).

I want it to redirect to checkout after the user creates an account. (i mean the user creates it after they put items in cart and want to check out).

  • Have you found any solution? – Knight017 Oct 18 '18 at 5:39
1

1- Check well this configuration in Admin:

STORES > Configuration > CUSTOMERS > Customer Configuration > Login Options > Redirect Customer to Account Dashboard after Logging in > No.

2- Delete your local storage, because Magento will set the cookie $.cookie('login_redirect', this.options.url.checkout) based on customerData from local storage.

From the controller vendor/magento/module-customer/Controller/Account/LoginPost.php. It will check the redirect URL from cookie.

EDIT:

You have to override a loginPost for redirecting to a custom page.

Exemple Magento 1, condition to apply it just if you are in this page: 'checkout page'

<?php $currentHandle = Mage::app()->getLayout()->getUpdate()->getHandles(); ?>
<?php if($currentHandle[3] == 'checkout_onepage_index'):?>
    //the code...
<?php endif;?>

For Magento 2: this

  • Thanks for your reply Prince. I tried this, but then it stays on the same page. here is the url. customer/account/login/referer/aHR0cDovL3d3dy5lbG5vcmEuYmUvY3VzdG9tZXIvYWNjb3VudC9pbmRleC8,/ It does go to checkout. So first i add a product to my cart, then checkout, then i get popup to login or create new account, i click on create new account...fill the information, then it stays the same page. I get on top thanks for making account. It does not even log me in. (2.1.4) – Fancyman Feb 23 '17 at 23:38
  • Have you delete the cache magento and the cache of your browser and also the cookies of the browser ? – PЯINCƏ Feb 23 '17 at 23:42
  • Yes i cleared static files and all cache still the same.. I found out our misunderstanding. "When the user" has an account already". So u add product in your cart, then checkout, then popup comes...here if you choose "login" then it stays on the same page. on the cart...it does not redirect to next page (checkout) it stays in that cart...but if the user clicks to make a new account "then makes it" after it makes it it stays on the same "page". I want to have it seamless process...i don't understand why it works like this. Thanks in advance! – Fancyman Feb 23 '17 at 23:47
  • i see that you have a referer redirect so after login, the user dont go to the dashboard but it stay in the current page and it's normal, if you want the redirect it to the checkout or some custom page you need to override the method loginPost() – PЯINCƏ Feb 24 '17 at 0:03
  • But problem is it will redirect everytime someone loges in. The idea is that it would work like magento 1. In magento one after you create your account(during buying process), it conitnues your checkout process. It makes the account then it comes to checkout for you to finish the rest. If i redirect now, it will also redirect "old clients" when they just login" or people who want to make an account without shoping/checking out. – Fancyman Feb 24 '17 at 0:08
0

I´ve seen many people with this issue including me. I created some code and made this composer package to solve it, please fetch it via composer:

composer require gustavoulyssea/magento-redirect-checkout

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.