Cart persistence
A persistent shopping cart tracks unpurchased items that are left in the cart and saves the information for the customer’s next visit. Customers who are remembered can have the contents of their shopping carts restored the next time they visit your store.
Using a persistent shopping cart can help reduce the number of abandoned shopping carts and increase sales. It is important to understand that the persistent shopping cart does not expose sensitive account information at any time. While the persistent shopping cart is in use, both registered customers and guest shoppers are required to either log into an existing account, or create an account before going through checkout. For guest shoppers, a persistent shopping cart is the only way to retrieve information from a previous session.
To manage the use of cart persistence for your site or within specific store views, you can configure persistent shopping cart settings. For more information about how these settings affect the shopper experience in your storefront, see Persistent cart workflow.
To use the persistent shopping cart, the customer’s browser must be set to allow cookies. There are two types of cookies used for shopping cart operations:
-
Session cookie – A short-term session cookie exists during a single visit to your site, and expires when the customer leaves, or after a set time period.
-
Persistent Cookie – A long-term, persistent cookie continues in existence after the end of the session and saves a record of the customer’s shopping cart contents for future reference.
Persistent cart workflow
When the persistent shopping cart is enabled, the workflow depends on:
- The values of the Enable Remember Me and Clear Persistence on Log Out settings
- The customer’s decision to select or clear the Remember Me checkbox
- When the persistent cookie is cleared
When a persistent cookie is applied, a Not Jane Smith?
link appears in the page header. This prompt gives the customer the ability to terminate the persistent session and start working as a guest, or to log in as a different customer. The system retains a record of the shopping cart contents, even if the customer later uses different devices to shop in your store. For example, a customer can add an item to the cart from a laptop computer, add more items from a mobile device, and complete the checkout process from a tablet.
There is a separate independent persistent cookie for each browser. If the customer uses multiple browsers while visiting your store during a single, persistent session, changes made in one browser are reflected in any other browser upon page refresh. While the persistent shopping cart is enabled, your store creates and maintains a separate persistent cookie for each browser that is used by a customer to log in or create an account.
Example: An open session on a shared computer
Jane is finishing her holiday shopping with a persistent session. She adds a present for John to her cart, and something for her mother. Then she goes to the kitchen for a snack.
John sits down at the computer to do some quick shopping while Jane is in the kitchen. Without noticing the Not Jane Smith?
link at the top of the page, he finds a nice present for Jane and adds it to the cart. When he goes to check out and logs in as himself, both items in Jane’s cart are added to his cart. John is in such a hurry that he does not notice the additional items during Order Review, and submits the order. Jane’s cart is now empty, and John bought all the gifts.
Remember Me
Customers can select the Remember Me checkbox on the login page to save the contents of their shopping carts.
Continue persistence on logout - no
Clear persistence on logout
Persistent cart settings and effects
No
.Clear Persistence on Log Out has any value.
The Remember Me checkbox is not available on the login and registration page.
Yes
.Clear Persistence on Log Out has any value.
Remember Me is not selected.
Yes
.Clear Persistence on Log Out is set to
Yes
.Remember Me is set to
Yes
.Not Jane Smith
link.Yes
.Clear Persistence on Log Out is set to
No
.Remember Me is set to
Yes
Not Jane Smith
link.Configure a persistent cart
During the setup of a persistent shopping cart, you can specify the lifetime of the cookies, and which options you want to make available for various customer activities.
For more information about how the customer workflow is determined by these settings, see Persistent cart workflow.
-
On the Admin sidebar, go to Stores > Settings > Configuration.
-
In the left panel, expand Customers and choose Persistent Shopping Cart.
-
To enable the persistent shopping cart and display additional options, set Enable Persistence to
Yes
.img-md w-600 modal-image For more information about each of these configuration settings, see the Configuration Reference
note note NOTE If needed, clear the Use system value checkbox to modify these settings. -
For Persistence Lifetime (seconds), enter the length of time, in seconds, that you want the persistent cookie to last.
The default value of 31,536,000 seconds is equal to one year. The maximum time allowed is 100 years.
-
Set Enable “Remember Me” to one of the following:
-
Yes
- Displays the Remember Me checkbox on the Login page of your store, so that customers can choose to save their shopping cart information. -
No
- Persistence can still be enabled, but customers are not given the option to choose if they want to save their information.
-
-
To preselect the Remember Me checkbox for the customer, set Remember Me Default Value to
Yes
.The customer can clear this option if they choose.
-
Set Clear Persistence on Log Out to one of the following:
-
Yes
- The shopping cart is cleared when a registered customer logs out. -
No
- The shopping cart is saved when a registered customer logs out.
note note NOTE If the session cookie expires while the customer is still logged in, the persistent cookie remains in use. -
-
Set Persist Shopping Cart to one of the following:
-
Yes
- If the session cookie expires, the persistent cookie is preserved. If a guest shopper later logs in or creates an account, the shopping cart is restored. -
No
- The shopping cart is not preserved for guests after the session cookie expires.
-
-
(Adobe Commerce only) Set Persist Wish List to determine if the state of customer wish lists is retained when the session ends:
-
Yes
- The wish list contents are saved when the session ends. -
No
- The wish list is not saved when the session ends.
-
-
(Adobe Commerce only) Set Persist Recently Ordered Items to determine if the state of recently ordered items is retained when the session ends:
-
Yes
- The state of Recently Ordered Items is saved when the session ends. -
No
- The state of Recently Ordered Items is not saved when the session ends.
-
-
Set Persist Currently Compared Products to
Yes
orNo
. -
Set Persist Comparison History to
Yes
orNo
. -
Set Persist Recently Viewed Products to
Yes
orNo
. -
(Adobe Commerce only) Set Persist Customer Group Membership and Segmentation to determine if the state of the customer’s group membership and segmentation criteria are retained when the session ends:
-
Yes
- The state of the customer’s group membership and segmentation data is saved when the session ends. -
No
- The state of the customer’s group membership and segmentation data are not saved when the session ends.
-
-
Click Save Config.