Skip to content

Commit 64fea1a

Browse files
Chhandak.BaruaChhandak.Barua
authored andcommitted
ACP2E-38: No shipping methods are available when new user is registered and products in cart are from guest session
1 parent 302f6c5 commit 64fea1a

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

app/code/Magento/Checkout/Model/Layout/DepersonalizePlugin.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ class DepersonalizePlugin
2828
*/
2929
private $checkoutSession;
3030

31+
/**
32+
* @var int
33+
*/
34+
private $quoteId;
35+
3136
/**
3237
* @param DepersonalizeChecker $depersonalizeChecker
3338
* @param CheckoutSession $checkoutSession
@@ -41,6 +46,19 @@ public function __construct(
4146
$this->checkoutSession = $checkoutSession;
4247
}
4348

49+
/**
50+
* Resolve quote data if the depersonalization is needed.
51+
*
52+
* @param LayoutInterface $subject
53+
* @return void
54+
*/
55+
public function beforeGenerateXml(LayoutInterface $subject)
56+
{
57+
if ($this->depersonalizeChecker->checkIfDepersonalize($subject)) {
58+
$this->quoteId = $this->checkoutSession->getQuoteId();
59+
}
60+
}
61+
4462
/**
4563
* Change sensitive customer data if the depersonalization is needed.
4664
*
@@ -51,6 +69,7 @@ public function afterGenerateElements(LayoutInterface $subject)
5169
{
5270
if ($this->depersonalizeChecker->checkIfDepersonalize($subject)) {
5371
$this->checkoutSession->clearStorage();
72+
$this->checkoutSession->setQuoteId($this->quoteId);
5473
}
5574
}
5675
}

0 commit comments

Comments
 (0)