Skip to content

Commit 44acd66

Browse files
author
Kostiantyn Poida
committed
Merge branch 'develop' of github.corp.ebay.com:magento-mpi/magento2ce into develop
2 parents 2353daf + d38c97c commit 44acd66

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

app/code/Magento/Checkout/Model/Type/Onepage.php

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,13 +491,19 @@ public function saveBilling($data, $customerAddressId)
491491
)->setCollectShippingRates(
492492
true
493493
)->collectTotals();
494-
$shipping->save();
494+
if (!$this->isCheckoutMethodRegister()) {
495+
$shipping->save();
496+
}
495497
$this->getCheckout()->setStepData('shipping', 'complete', true);
496498
break;
497499
}
498500
}
499501

500-
$this->quoteRepository->save($this->getQuote());
502+
if ($this->isCheckoutMethodRegister()) {
503+
$this->quoteRepository->save($this->getQuote());
504+
} else {
505+
$address->save();
506+
}
501507

502508
$this->getCheckout()->setStepData(
503509
'billing',
@@ -516,6 +522,16 @@ public function saveBilling($data, $customerAddressId)
516522
return [];
517523
}
518524

525+
/**
526+
* Check whether checkout method is "register"
527+
*
528+
* @return bool
529+
*/
530+
protected function isCheckoutMethodRegister()
531+
{
532+
return $this->getQuote()->getCheckoutMethod() == self::METHOD_REGISTER;
533+
}
534+
519535
/**
520536
* Validate customer data and set some its data for further usage in quote
521537
*

0 commit comments

Comments
 (0)