Persistent Shopping Cart

How to let a customer pick up where they left off when they log back in to an unfinished sale, in Magento.

By Suada Cane

Persistent Shopping Cart is a Magento feature that allows a customer to log off his or her computer and log back in after some time to pick up where they left off.

This feature relies on the use of Browser Cookies, so if the user is logged in on a browser not allowing cookies, this won’t work for them.

First, Persistent Shopping Cart must be enabled.  To do this, got toSystem > Configuration > Customer > Persistent Shopping Cart

Expand the General Options Tab and set Enable Persistence to Yes.

By default, the Persistence Lifetime (seconds) is already set to the maximum value, 31536000 seconds, which is 100 years. You can change this as you see fit. 

What this does set the time a cookie has until it expires.  If you set this for a month (2628000 seconds), the cookie will expire. So in that scenario, a customer who hasn’t logged in for over a month will lose what they had in their cart the last time they had logged in.

The Enable “Remember Me” option is the checkbox that will appear on the log in screen. 

If Enable “Remember Me” is set to Yes, the persistent cookie will be placed for users who check that off. If it’s set to No, the cookie will be placed only for users who already have it.

The “Remember Me” governs if the checkbox is checked by default or not. 

Clear Persistence on Log Out will delete the persistent cookie when the customer logs out. If you set this to Yes, items where you have persistence turned on (we’ll use shopping cart as an example) will be cleared.  So if a customer logs out with 4 items in their cart, the cart will be cleared to 0.  If you set this to No, and that same customer with 4 items logs out, their cart will still hold those same 4 items with them logged out but still displaying their name where the default message is — to check out with those items, they’ll have to log in again.

  • In this scenario, if a second person were to come in and see the cart with the items, add more items to that cart or just check out with those items, they will be prompted to log in.  Logging in with Person #2’s account will add all those items to their checkout and clear them from Person #1.

The rest of the options, all beginning with Persist govern which sections of the site you want to persist.