How to enable persistent shopping cart in magento 2.1?
I want to do clear cart item on user sign out from sites. I have already setup from
Stores -> Configuration -> Customers -> Persistent Shopping Cart
Enable Persistence set to Yes
,
Clear Persistence on Sign Out set to Yes
But nothing affect in cart items.
How to do this using persistent shopping cart functionality in magento 2?
Goal: Remove Cart item when customer become logout.
Best Answer
Please make change in following setting. Go to following setting in admin:
Persist Shopping Cart set to No
If still it'll not work. Make small module like following.To remove Cart item when customer logout. You can make small module for this functionality. The code is verified and it is working in Magento 2.1.
app/code/Rohit/UserCart/registration.php
app/code/Rohit/UserCart/etc/module.xml
app/code/Rohit/UserCart/etc/frontend/events.xml
app/code/Rohit/UserCart/Observer/EmptyCartLogout.php
After that run following command at your magento root
Hope this will helpful to you