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 c2a6be533e8ea..cdc03115e443b 100644 --- a/vendor/magento/module-persistent/etc/di.xml +++ b/vendor/magento/module-persistent/etc/di.xml @@ -25,6 +25,9 @@ + + + 500