My guest checkout is disable so while clicking to proceed to checkout from mini cart it shows a login popup.after login from this popup i want to redirect to checkout but it redirect to the same page first after login . Can any one help to redirect the site to checkout page after ajax login.

  • Then why you have kept guest checkout disable. Aug 14, 2020 at 19:37
  • my requirement is quite like that i need to disable guest check out. But again need this while guest checkout is disable. Aug 17, 2020 at 6:11

1 Answer 1


Please preference for Magento\Customer\Controller\Ajax\Login

replace -

$response['redirectUrl'] = $this->_redirect->success($redirectRoute); 


$response['redirectUrl'] = $this->_redirect->success($this->storeManager->getStore()->getUrl('onestepcheckout'));

and Also add

public function __construct(
  \Magento\Store\Model\StoreManagerInterface $storeManager
 ) {
      $this->storeManager = $storeManager;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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