diff --git a/vendor/magento/module-persistent/Model/Plugin/AllowPersistentCustomerGuestCart.php b/vendor/magento/module-persistent/Model/Plugin/AllowPersistentCustomerGuestCart.php new file mode 100644 index 0000000000000..5ba173320b2ad --- /dev/null +++ b/vendor/magento/module-persistent/Model/Plugin/AllowPersistentCustomerGuestCart.php @@ -0,0 +1,58 @@ +persistentHelper->isShoppingCartPersist() + && !$this->customerSession->isLoggedIn() + && $this->persistentSession->isPersistent() + && (int) $this->persistentSession->getSession()->getCustomerId() === $customerId; + + if (!$isOwnedByPersistedCustomer) { + $proceed($customerId, $maskedCartId); + } + } +} diff --git a/vendor/magento/module-persistent/etc/di.xml b/vendor/magento/module-persistent/etc/di.xml index fd1c97fae66d9..efa49a4053bea 100644 --- a/vendor/magento/module-persistent/etc/di.xml +++ b/vendor/magento/module-persistent/etc/di.xml @@ -22,4 +22,7 @@ Magento\Checkout\Model\Session\Proxy + + +