Skip to content

Commit 31fd382

Browse files
author
Kostiantyn Poida
committed
MAGETWO-31168: Investigate increase of checkout steps load time
- fix for review
1 parent 751a725 commit 31fd382

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,15 +491,15 @@ public function saveBilling($data, $customerAddressId)
491491
)->setCollectShippingRates(
492492
true
493493
)->collectTotals();
494-
if ($this->getQuote()->getCheckoutMethod() != self::METHOD_REGISTER) {
494+
if (!$this->isCheckoutMethodRegister()) {
495495
$shipping->save();
496496
}
497497
$this->getCheckout()->setStepData('shipping', 'complete', true);
498498
break;
499499
}
500500
}
501501

502-
if ($this->getQuote()->getCheckoutMethod() == self::METHOD_REGISTER) {
502+
if ($this->isCheckoutMethodRegister()) {
503503
$this->quoteRepository->save($this->getQuote());
504504
} else {
505505
$address->save();
@@ -522,6 +522,16 @@ public function saveBilling($data, $customerAddressId)
522522
return [];
523523
}
524524

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+
525535
/**
526536
* Validate customer data and set some its data for further usage in quote
527537
*

0 commit comments

Comments
 (0)