diff --git a/app/code/Magento/LoginAsCustomer/Model/Login.php b/app/code/Magento/LoginAsCustomer/Model/Login.php index fdbc725306ab9..e4c1e55b30a27 100755 --- a/app/code/Magento/LoginAsCustomer/Model/Login.php +++ b/app/code/Magento/LoginAsCustomer/Model/Login.php @@ -17,8 +17,6 @@ class Login extends \Magento\Framework\Model\AbstractModel */ const TIME_FRAME = 60; - const XML_PATH_KEEP_GUEST_CART = 'mfloginascustomer/general/keep_guest_cart'; - /** * Prefix of model events names * @@ -189,19 +187,10 @@ public function authenticateCustomer(): \Magento\Customer\Model\Customer /* Logout if logged in */ $this->_customerSession->logout(); } else { - $quote = $this->cart->getQuote(); - - $keepItems = $this->scopeConfig->getValue( - self::XML_PATH_KEEP_GUEST_CART, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ); - - if (!$keepItems) { - /* Remove items from guest cart */ - foreach ($quote->getAllVisibleItems() as $item) { - $this->cart->removeItem($item->getId()); - } + /* Remove items from guest cart */ + foreach ($quote->getAllVisibleItems() as $item) { + $this->cart->removeItem($item->getId()); } $this->cart->save(); } diff --git a/app/code/Magento/LoginAsCustomer/etc/adminhtml/system.xml b/app/code/Magento/LoginAsCustomer/etc/adminhtml/system.xml index 75a6dd5993dce..f807ec6d366ac 100755 --- a/app/code/Magento/LoginAsCustomer/etc/adminhtml/system.xml +++ b/app/code/Magento/LoginAsCustomer/etc/adminhtml/system.xml @@ -7,28 +7,23 @@ --> -
+
separator-top customer Magento_LoginAsCustomer::config_section - + - + Magento\Config\Model\Config\Source\Yesno - + Magento\Config\Model\Config\Source\Yesno - - - Magento\Config\Model\Config\Source\Yesno - - - + Magento\LoginAsCustomer\Model\Config\Source\StoreViewLogin