Configure Basket Preferences
Configurable basket settings include persistence across shopper sessions, the treatment of duplicate product line items, and the maximum number of product line items per basket. These preferences are site-specific, and a customized storefront doesn’t necessarily evaluate them.
To set basket behavior preferences for the current site, select
Basket Persistence Across Storefront Sessions
To configure the behavior of baskets when user sessions start and end, use the persistence and lifetime settings.
The following rules are always in effect, regardless of the settings.
- When a customer creates a basket, and then registers or logs in, that basket remains in the session and ownership of it transfers to the customer.
- When a customer logs out, the current basket is cleared from the session, even if it’s also saved.
- When a basket’s lifetime expires, the system deletes it within one minute.
- After seven days, the system automatically deletes any payment information from a basket.
- A basket that doesn’t belong to a registered customer never persists for longer than seven days.
The Basket Persistence setting defines which customers can access saved baskets from previous sessions. The basket lifetimes define how long a saved basket remains available.
Basket Persistence | Description |
---|---|
Baskets Not Persistent | When a session ends, the basket is not saved. Every session begins with an empty basket. |
Baskets Persistent for Authenticated Customers Only | When a registered customer’s session ends, the current basket is cleared but its contents are saved. If that customer opens a new session and logs in within the basket lifetime for registered customers, the saved basket is restored. If the customer started a new basket before logging in, the saved basket is available via API calls. |
Baskets Persistent for Registered Customers Only | When a registered customer’s session ends, the current basket is cleared but its contents are saved. If the system recognizes that customer in a new session within the basket lifetime for registered customers, the saved basket is restored. If the customer started a new basket before being recognized, the saved basket is available via API calls. |
Baskets Persistent for All Customers | When any customer’s session ends, the current basket is cleared but its contents are saved. If that customer opens a new session within the basket lifetime for the appropriate customer type, the saved basket is restored. |
You can define different lifetimes for registered and unregistered (guest) customers. The following rules apply to basket lifetimes:
- A basket’s lifetime is measured from the time of its last change. Opening or refreshing the basket page does not reset its lifetime.
- The default lifetime for registered customers is 240 minutes (four hours).
- We recommend a lifetime between 21,600 minutes (14 days) and 43,200 minutes (30 days), unless you have a specific use case for a different length. The Maximum Basket Lifetime API quota of 525,600 minutes (365 days) applies to the lifetime for registered customers. For information on API quotas, see the API documentation.
- The maximum lifetime for unregistered customers is the smaller of 43,200 minutes (30 days) or the lifetime for registered customers.
- If you don’t specify a lifetime for unregistered customers, it defaults to the maximum lifetime.
Behavior When Adding a Duplicate Product to a Basket
The Add Product to Basket Behavior setting controls the behavior when a customer tries to add a product that’s identical to one in their basket. Products are compared using the following rules:
- If the preference is Disallow Repeats or Increment Quantity, then products are duplicates if they have the same SKU, product list ID, and inventory list ID. For purposes of this comparison, a null list ID only matches another null list ID. For example, a product that isn’t on an inventory list can only match another product that isn’t on an inventory list.
- If the preference is Allow Repeats, then adding a product doesn’t affect any existing product line items.
- Option products are always added to a new product line item, regardless of the preference setting.
- Product bundles that contain base products are always added to a new product line item, regardless of the preference setting.
- If an attribute changes on a product that’s in the basket, the system does not repeat the duplicate check.
Add Product to Basket Behavior | Description |
---|---|
Disallow Repeats | Ignore the request. |
Increment Quantity | Add to the quantity of the existing product line item. This setting is the default. |
Allow Repeats | Add another product line item for the same product. |
Maximum Product Line Items Per Basket
To limit the number of product line items allowed in a basket, enter a value in the Max Number of Product Line Items field. Attempting to add product line items beyond this limit returns an error. The limit considers only the number of lines, not their quantities. The default value is 50.