Skip to content

logging-in in order to checkout when guest checkout is disabled #6015 #24794

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: 2.4-develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
<argument name="customerEmail" value="$$createCustomer.email$$"/>
<argument name="customerPwd" value="$$createCustomer.password$$"/>
</actionGroup>
<click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="goToCheckout1"/>
<waitForPageLoad stepKey="waitForShippingMethodSectionToLoad"/>
<waitForElementVisible selector="{{CheckoutShippingMethodsSection.next}}" stepKey="waitForNextButton"/>
<click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickOnNextButton"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ define([
event.preventDefault();

if (!customer().firstname && cart().isGuestCheckoutAllowed === false) {
// set URL for redirect on successful login/registration. It's postprocessed on backend.
$.cookie('login_redirect', config.checkoutUrl);
authenticationPopup.showModal();

return false;
Expand Down
2 changes: 2 additions & 0 deletions app/code/Magento/Customer/Controller/Account/CreatePost.php
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,8 @@ public function execute()
}
$this->session->regenerateId();
try {
/** Clear redirect cookie to prevent redirect to other pages*/
$this->accountRedirect->clearRedirectCookie();
$address = $this->extractAddress();
$addresses = $address === null ? [] : [$address];
$customer = $this->customerExtractor->extract('customer_account_create', $this->_request);
Expand Down