How to Configure Persistent Cart in Magento 2

In the last blogs, we’ve provided you a general view of Persistent Cart and the way it works in stores using Magento 2 platform. Accordingly, this article will give you information about how to configure persistent cart through the backend. During the setup process, admins can choose to activate the persistent cart or not, set up the time due for the sessions and other options for the Persistent Cart.

To set up for the Persistent Cart in Magento 2, do the following:

  1. Sign in with your admin account. On the Admin Sidebar, click Stores.
  2. Next, select Configuration under Settings.
  3. On the left panel, expand the row named Customers. Choose Persistent Shopping Cart after that.
  4. If the Enable Persistence box is set to “No”, there will be only one section on the working space. In that case, you need to change the box to “Yes” to enable persistent cart and go on further setting options. If the Enable Persistence box is set to “Yes” already, just do the next step as below.

a. Persistence Lifetime (seconds): The lifetime of the persistent cookie. You can enter any number that fit your preference (remember that the unit is “second”). The maximum time allowed for the cookie is 31,536,000 seconds which is equal to one year. This number is also set as the default number of the field.

b. Enable “Remember Me”: There are two options here:

  • Yes: Allow the “Remember me” checkbox to be available on the log-in page so that your customers’ information is saved for the next visit.
  • No: The “Remember me” checkbox is not displayed on the log-in page. Customers have to fill in their information every time they shopping in your store.

c. Remember Me Default Value: Set this to “Yes” to preselect the “Remember me” checkbox.

d. Clear Persistence on Log Out: This box gives options to end/ or continue the persistence on customers’ shopping cart when they log out.

  • If it is set to “Yes”, persistent settings for all entities will be cleared once a registered customer logs out. The entities are: Shopping Cart, Wish List, Recently Ordered Items, Currently Compared Products, Comparison History, Recently Viewed Products, and Customer Group association.
  • In contrast, all the mentioned entities will be retained if the box is set to “No”.

e. Persist Shopping Cart: You can choose one of the following:

  • “Yes”: When a customer logs out, the session cookie expires but , the persistent cookie is still in use. When that customer logs in, the shopping cart is restored.
  • “No”: Not-registered customers’ shopping cart is not preserved after the session cookie expires.

Persistent Cart

  1. When finishing all the settings, tap Save Config to save the changes.

Those are 5 steps to Configure Persistent Cart in Magento 2 you should know to manage your online store. Now, let’s try the configuration and see what it can do for your customers.

An Overview of Persistent Cart in Magento 2

A Persistent Cart is a tool provided by Magento 2, which is one of the most popular platforms used by e-commerce businesses. Once this tool is enabled by admin in the backend, it will keep tracks of items that are added to cart but have not been purchased by customers. The information saved will be shown up in the next time that customer shopping on your store. In other words, a “remembered” customer can have their previous buying activities stored and be available for the next visit.

From a store owner point of view, a Persistent Cart can help to bring better shopping experiences to your customers, improve your brand image and gain more loyal customers to your store. Moreover, a persistent shopping cart can minimize the number of empty carts, which results in an increase in sales.

When the Persistent Cart is activated, registered customers are required to log in with their own accounts before going through checkout. For guest shoppers, they need to sign up with new account if they want to recover information from their last shopping.

In order to use the Persistent Cart, customers have to enable two cookies for their browsers. During the operation, these following two cookies are required:

  • Session Cookie: Is a short-term cookie. Its duration is only a single customer visit to your site. In other words, the cookies starts when a customer logs in and expires when that customer leaves.
  • Persistent Cookie: Is a long-term cookie. Unlike Session Cookie, Persistent Cookie remains functioning even when customers leave the store. This cookie also allow to record the contents of customers’ shopping activities for future reference. Persistent Cookie duration can be set to a period of time depending on your preference, but the maximum is 31,536,000 seconds (this number is equal to one year) set by default Magento 2.

Up to now, you may have a clear overview of Persistent Cart used in Magento 2. Don’t forget to Like, Share, and Subscribe to Magestandard for more informative Magento extension review articles.

How Persistent Cart Works in Magento 2

In Magento 2, the Persistent Shopping Cart does not necessarily follow a solid workflow. In other words, it depends on the value in the backend settings. For each value set to the “Enable Remember Me” and the “Clear Persistence on Logout” fields, the Persistent Cart works in a different way. It also depends on the admin’s decision to select or clear the “Remember Me” checkbox.

When a persistent cookie is activated, a “Not%[the last user’s name]%?” link (Not %John Smith%? for example) will appear in the top of the current page. The function of that link is to give customers options to close the persistent session and start working as a guest or to log in with another account. In addition, the persistent cookie has impact on the workflow of persistent shopping cart. Because it helps to maintain settings for the Shopping Cart, Wish List, Recently Ordered Items, Currently Compared Products, Comparison History, Recently Viewed Products, and Customer Group associations.

The system can also keep tracks of the shopping cart contents, no matter which devices your customers use to shop. For instance, at first, a shopper uses a laptop to add items to her cart. She then can edit the cart contents from a mobile device, and complete the checkout process from a tablet or a desktop computer.

Your store can create and maintain an independent persistent cookie for each browser that is used by a customer to log in or create an account once the persistent shopping cart is applied. Thanks to the persistent cookie, any changes made will be updated to browsers even if the customer use more than one browser for one time shopping on your store.

There are four common effects on the persistent shopping cart workflow, which depends on the settings below:

Situation 1: Enable Remember Me = “No”

Clear Persistence on Log Out = any value

Effects: The Remember Me checkbox is not available when customers on the login and registration pages. The persistent cookie is not applied.

Situation 2: Enable Remember Me = “Yes”

Clear Persistence on Log Out = any value

Remember Me = (not being selected)

Effects: The session cookie is applied as usual; the persistent cookie is not used.

Situation 3: Enable Remember Me = “Yes”

Clear Persistence on Log Out = “Yes”

Remember Me = “Yes”

Effects: Both session and persistent cookies are enabled when customers log in. These two cookies are also terminated when buyers finish shopping and log out. If a customer does not log in, but the session cookie become invalid, the persistent cookie still keep working. If a customer does not log out, the persistent cookie can also be deleted if its lifetime is out of due or if the customer clicks the Not %John Smith% link.

Situation 4: Enable Remember Me = “Yes”

Clear Persistence on Log Out = “No”

Remember Me = “Yes”

Effects: Both cookies are used when customers log in. When shoppers log out, only session cookie is closed. Persistent cookie is deleted only when its lifetime runs out or when the buyer click the Not %John Smith% link.

Clearly understand how Persistent Shopping Cart works with different values set to it will help you a lot in managing your online store. Therefore, come back to the beginning and read again this article if you still confuse about Persistent Shopping Cart workflow. If not, keep follow us to receive more instructions about Persistent Shopping Cart in Magento 2.