Carts

Carts are created by shoppers, not by staff, so the module has settings but no list to edit. What a cart holds, how long it lasts, and why one goes missing.

A cart is a record

A cart is saved the first time something needs it: an item being added, or the cart page opening. The browser finds it again through a cookie, so the cart outlives the visit, and a signed-in customer's cart follows them to another device.

A cart holds its items (each with the product, the quantity, the price, discount and tax, and whether it can still be bought), the discount codes entered and the discounts that applied, the totals, and a currency, set by the first item added. It has no addresses and no shipping: those arrive with the checkout.

Because shoppers create carts, the admin has only the Carts settings, with no list of carts to edit.

How long a cart lasts

A guest's cart that has not changed for the cart lifetime (180 days unless the Lifetime setting says otherwise) is deleted. A signed-in member's cart is kept however old it is. When an order is placed, the items bought leave the cart, and a cart left empty is deleted.

Signing in with a cart

When a guest with a cart signs in, the cart becomes theirs; if they already had a cart, the guest cart's items are added to it, and quantities of the same product add up on one line. Options on an item, such as an engraving note, are not carried over in that merge, so a customer who personalised items as a guest should check the cart after signing in.

Abandoned carts and the restore link

A cart counts as abandoned when it holds items, belongs to someone with an email address, has not changed for an hour (the Abandoned Threshold setting) and has no checkout in progress. The platform then raises the cart's Abandoned event, once, and a job (formerly hook) can turn it into a reminder email.

Every cart has a restore link that brings it back in any browser: the link to put in that email. It opens the cart for whoever holds it, so send it only to the cart's owner.

"My cart emptied"

Check, in this order: the shopper moved between two addresses of the site (with and without www), a page was served over plain http, they signed out, they bought the items, they used another browser or a private window, or a guest cart expired.

Developers: The cart in the commerce guide.

Was this page helpful?

Your answer goes to the docs team.