How Does Magento 2’s Persistent Shopping Cart Work for Guests?
Learn how Magento 2 persistent carts work for guests, when cookies may restore a cart, and why account-based persistence is more reliable.
Magento 2’s persistent shopping cart does not provide a guaranteed, long-term saved cart for shoppers who stay guests. A guest cart may remain available through browser cookies, but Adobe’s current documentation limits the persistent-cart feature to registered customers.
How does the Magento 2 persistent shopping cart work for guest shoppers?
For a guest, it is not the same account-linked persistence that Magento provides to a signed-in customer. Adobe says guest shoppers cannot use the persistent shopping cart feature; that feature uses a persistent cookie to keep a signed-in customer’s cart accessible after their login session expires. (experienceleague.adobe.com)
A guest cart can still be associated with the shopper’s browser: Adobe lists a persistent_shopping_cart cookie that stores a key used to restore a cart for an anonymous shopper. That is browser-based recovery, not a promise that Magento will retain the cart indefinitely or make it available on another device. (experienceleague.adobe.com) If the browser no longer has the relevant cookie, or the cart data is no longer available, the guest may have to rebuild the cart.
The distinction matters: a returning guest may see their cart, but should not rely on the persistent-cart setting as an account-free, cross-device save. For more dependable recovery, the shopper needs to sign in; then Magento can associate cart persistence with their customer account.
Can guest shoppers restore their carts after returning to a Magento 2 store?
Sometimes, if they return in the same browser while the cart’s cookie and associated cart data are still available. Adobe documents a cookie key for restoring an anonymous shopper’s cart, but does not describe that as the persistent-cart feature available to guests. (experienceleague.adobe.com)
An older Magento Commerce guide describes a related flow: when Persist Shopping Cart is set to Yes, a guest’s cart can be restored if they later log in or create an account. Because current Adobe documentation says guests cannot use persistent cart, treat that older behavior as version-dependent and test it on your installation rather than promising it to shoppers. (commerce-docs.github.io)
Guest recovery is a poor fit when shoppers often switch browsers or devices, clear cookies, or return after a long gap. For those cases, account-based persistence is the more reliable option, but it requires shoppers to register or sign in.
How do I enable persistent shopping carts for guests in Magento 2?
You can enable the persistent-cart settings, but they do not turn on durable guest-only persistence in current Adobe documentation. In Admin, go to Stores > Settings > Configuration > Customers > Persistent Shopping Cart > General Options, set Enable Persistence to Yes, and set Persist Shopping Cart to Yes if the setting is available. Adobe describes the latter as allowing the persistent cookie to access the cart for the corresponding account. (experienceleague.adobe.com)
Set Persistence Lifetime to the period you want the persistent cookie to last, and save the configuration. Remember Me controls whether a shopper can choose to remain remembered; it is relevant to signed-in customers, not a way to make guest carts persist. The browser must allow cookies for persistent-cart behavior to work. (experienceleague.adobe.com)
If the requirement is to restore carts for shoppers who never create or use accounts, do not assume this configuration alone will meet it. You would need to verify the behavior in your Magento version or use a solution specifically designed for guest-cart retention.