Sunday , November 24 2024
Home > Magento Tips & News > Magento 2 Tutorials > Sales > How to Configure Magento 2 Persistent Shopping Cart

How to Configure Magento 2 Persistent Shopping Cart

magento 2 persistent shopping cart

If you land here, you must find the most straightforward guide to configuring Magento 2 Persistent Shopping Cart. Lucky you, this is the right place! I promise to give the knowledge and guidance I will give out and address them in the least complicated way.

But first, let’s find out what exactly a persistent cart is through this example. Well, a customer is interested in a particular product in your e-store, they add it to the cart but haven’t proceeded to checkout yet. This may be because they can not afford it right now or just want to learn about the same products from other stores before purchasing. And when they leave their store site, they expect that next time, when they come back, the product they have selected will still be in the cart. In this case, the Magento store owner, like you, enables Persistent Shopping Cart in their Magento 2 store to meet their customer’s desires.

Simple as it may sound, you should thoroughly understand how a persistent cart works to make use of it. And after that, I’ll show you how to configure Persistent Shopping Cart Magento 2. 

Understanding the Workflow of a Persistent Cart

To use a 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 – this is a short-term session cookie that lasts for the duration of a single visit to your website and becomes invalid when the customer leaves or after a set period of time.
  • Persistent Cookie – this is a long-term, persistent cookie that continues to exist after the end of the session. This cookie saves a record of the customer’s shopping cart’s contents.

Once Persistent Shopping Cart is enabled, its workflow varies according to the values in the backend settings. When each value is set to Enable Remember Me or Clear Persistence on Log Out settings, the persistent cart Magento 2 works differently. (See full explanation). Moreover, the customer ticks or unticks the Remember Me checkbox and decides when the persistent cookie is cleared.

persistent cart magento 2

When a persistent cookie is applied, a “Not [the last user’s name]?” link (for example, “Not Felicia Duong?”) appears at the top of the page. In this case, the customer is able to end the persistent session and start visiting as a guest shopper or log in to another account. Furthermore, the persistent cookie influences the workflow of the persistent shopping cart. It helps to maintain settings for the Shopping Cart, Wish List, Currently Compared Products, Recently Ordered Items, Recently Viewed Products, Comparison History, and Customer Group associations.

The system also records the shopping cart’s contents, whichever devices the customer uses to visit your store later on. For example, the customer first accesses your store through a mobile phone, then adds some items to and removes a few from the cart with their tablet, and finally completes their payment process on a PC.

online shopping cart

For each browser, there is a different cookie. If the customer uses many different browsers when shopping in your store during a single, persistent session, the actions made in one browser will be saved to others. This can be done when the persistent shopping cart is enabled.

Persistent shopping cart settings & their effects

There are four persistent cart settings and four effects accordingly.

Setting 1Setting 2
Enable Remember Me: “No”
Clear Persistence on Log Out: any value
Remember Me checkbox: not available to select
→ The persistent cookie is not in use.
Enable Remember Me: “Yes”
Clear Persistence on Log Out: any value
Remember Me checkbox: not selected
→ The session cookie is applied as usual; the persistent cookie is in use.
Setting 3Setting 4
Enable Remember Me: “Yes”
Clear Persistence on Log Out: “Yes”
Remember Me checkbox: “Yes”
→ Both cookies (Session Cookie and Persistent Cookie) are applied once the customer logs in and erased when they log out. The persistent cookie is still in use if a customer does not log in but the session cookie expires. The persistent cookie is terminated when the customer logs, when they click the “Not [the last user’s name]?” link, or when its lifetime runs out.
Enable Remember Me: “Yes”
Clear Persistence on Log Out: “No”
Remember Me checkbox: “Yes”
→ Both cookies (Session Cookie and Persistent Cookie) are applied once the customer logs in. But when they log out, the session cookie is terminated while the persistent session continues. The persistent cookie is terminated not only when the customer clicks the “Not [the last user’s name]?” link or when its lifetime runs out.

Optimize Your Magento Store With Powerful Extensions!

Looking for fast, efficient, and well-coded extensions to build or optimize your Magento stores for sales-boosting? Then visit the Magezon website and grab the necessary add-ons for yours today!

How to Configure Magento 2 Persistent Shopping Cart

Now you’ve thoroughly explained and understood the workflow of the Magento persistent shopping cart. Let’s dive into configuring it. 

Step 1: Log in to the Admin panel, and navigate to Stores > Settings > Configuration.

persistent shopping cart magento 2

Step 2: You’ll see the sub-category Customers on the left. Now expand it and select Persistent Shopping Cart.

magento persistent shopping cart

Step 3: In General Options:

persistent shopping cart general option
  • For Enable Persistence, set to Yes to configure the persistent shopping cart and show other options.
  • For Persistence Lifetime (seconds), set the time that the persistent cookie lasts (in seconds). The default value is 31,536,000 seconds.
  • For Enable “Remember Me,” set to one of these:
Yes – If you want the Remember Me checkbox to appear on the Login page of your store so that customers can choose to save the information in their shopping cart.
No – Persistence can still be enabled, but customers cannot choose whether they want to save their information.
  • For Remember Me Default Value, set it to Yes to preselect the Remember Me checkbox for the customer. They can deselect this option if they choose.
  • For Clear Persistence on Log Out, set to one of these:
Yes – The shopping cart is cleared once a registered customer signs out.
No – The shopping cart is saved once a registered customer signs out.
  • (Commerce edition only) For Persist Wish List, you decide whether the state of customer wish lists is saved once the session ends:
Yes – The contents of the wish list are retained once the session ends.
No – The contents of the wish list are not retained once the session ends.
  • (Commerce edition only) For Persist Recently Ordered Items, you can decide whether the state of recently ordered items is saved once the session ends:
Yes – The state of Recently Ordered Items is retained once the session ends.
No – The state of Recently Ordered Items is not retained once the session ends.
  • Set Persist Currently Compared Products to Yes or No.
  • Set Persist Comparison History to Yes or No.
  • Set Persist Recently Viewed Products to Yes or No.
  • For Persist Customer Group Membership and Segmentation, you can decide whether the state of customers’ group membership and segmentation criteria are saved once the session ends:
Yes – The state of the customer’s group membership and segmentation data is retained once the session ends.
No – The state of the customer’s group membership and segmentation data is not retained once the session ends.

Step 4: When you’ve done this, click Save Config.

You might be interested in Magento 2 Shopping Cart Configuration: A Detailed Instruction

Isn’t That Easy?

Well, configuring the Magento 2 Persistent Shopping Cart is just as simple as that. If you have any questions or suggestions to better our content, please leave us a comment. 

For more guides and instructions like this, visit our collection of Magento tutorials.

At Magezon, we also provide you with many fast, well-coded, yet affordable extensions for your store optimization. Visit our website to opt for the necessary ones!

Optimize Your Magento Store With Powerful Extensions!

Looking for fast, efficient, and well-coded extensions to build or optimize your Magento stores for sales-boosting? Then visit the Magezon website and grab the necessary add-ons for yours today!

About Felicia Duong

Felicia Duong
A not-so-prolific writer, a bibliophile and a film photography enthusiast.

Check Also

Magento 2 Shopping Assistance and How It Works

Table of contents1. Allows Remote Shopping Assistance2. Manage the Current Shopping CartScenario 1: Help Costello …

Leave a Reply