diff --git a/vendor/magento/module-checkout/Model/Layout/DepersonalizePlugin.php b/vendor/magento/module-checkout/Model/Layout/DepersonalizePlugin.php index 2f39cb69076..637bb6aae19 100644 --- a/vendor/magento/module-checkout/Model/Layout/DepersonalizePlugin.php +++ b/vendor/magento/module-checkout/Model/Layout/DepersonalizePlugin.php @@ -28,6 +28,11 @@ class DepersonalizePlugin */ private $checkoutSession; + /** + * @var int + */ + private $quoteId; + /** * @param DepersonalizeChecker $depersonalizeChecker * @param CheckoutSession $checkoutSession @@ -41,6 +46,19 @@ class DepersonalizePlugin $this->checkoutSession = $checkoutSession; } + /** + * Resolve quote data if the depersonalization is needed. + * + * @param LayoutInterface $subject + * @return void + */ + public function beforeGenerateXml(LayoutInterface $subject) + { + if ($this->depersonalizeChecker->checkIfDepersonalize($subject)) { + $this->quoteId = $this->checkoutSession->getQuoteId(); + } + } + /** * Change sensitive customer data if the depersonalization is needed. * @@ -51,6 +69,7 @@ class DepersonalizePlugin { if ($this->depersonalizeChecker->checkIfDepersonalize($subject)) { $this->checkoutSession->clearStorage(); + $this->checkoutSession->setQuoteId($this->quoteId); } } }