Skip to content

Commit 751a725

Browse files
author
Kostiantyn Poida
committed
MAGETWO-31168: Investigate increase of checkout steps load time
- save quote only when customer uses checkout method register
1 parent 5ce1235 commit 751a725

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

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

Lines changed: 8 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->getQuote()->getCheckoutMethod() != self::METHOD_REGISTER) {
495+
$shipping->save();
496+
}
495497
$this->getCheckout()->setStepData('shipping', 'complete', true);
496498
break;
497499
}
498500
}
499501

500-
$address->save();
502+
if ($this->getQuote()->getCheckoutMethod() == self::METHOD_REGISTER) {
503+
$this->quoteRepository->save($this->getQuote());
504+
} else {
505+
$address->save();
506+
}
501507

502508
$this->getCheckout()->setStepData(
503509
'billing',

0 commit comments

Comments
 (0)