Configuring Basket Persistence

When a customer registers or logs in, the basket of the current registered or unregistered customer remains in the session and becomes the basket of the new customer (change of ownership). The basket of a registered customer disappears from the session when the customer logs out.

Using Business Manager, you can configure whether baskets are preserved for a certain period of time or disappear at the termination of a user session. You can enable basket persistence for all customers, registered customers, or authenticated customers.

Note: Regardless of your configuration, payment information is automatically deleted from a basket after seven days.

These preferences are site-specific. Your customized storefront might not necessarily evaluate these preferences.

See Order Management for Developers for information on obsolete basket cleanup.

  1. Select site > Merchant Tools > SitePreferences > Baskets.
  2. On the Basket Preferences page, select a Basket Persistence option:
    • Baskets Not Persistent: All baskets disappear at the end of the storefront session. The basket of the customer's previous session isn't restored if the customer returns to the storefront in a new session.
    • Baskets Persistent for Authenticated Customers Only: The basket of a registered customer's previous session is restored if the customer returns to the storefront and logs in.

      Customer baskets are stored for the duration, configured with Basket Lifetime. If a customer logs in and there is no current session basket, the basket of the registered customer's previous session is restored. Otherwise, the current session basket becomes the basket of the customer and the previous basket is provided through the API.

    • Baskets Persistent for Registered Customers Only: The basket of a registered customer's previous session is restored if the customer returns to the storefront and is recognized by Salesforce B2C Commerce.

      The basket of a registered customer's previous session is restored if the customer returns to the storefront and is recognized by B2C Commerce. Customer baskets are stored for the duration, configured with Basket Lifetime. If a customer logs in and there is no current session basket, the basket of the registered customer's previous session is restored. Otherwise, the current session basket becomes the basket of the customer and the previous basket is provided through the API.

    • Baskets Persistent for All Customers: The basket of a customer's previous session is restored if the customer returns to the storefront in a new session.

      The basket of a customer's previous session is restored if the customer returns to the storefront in a new session. Customer baskets are stored for the duration, configured with Basket Lifetime. If a customer logs in and there is no current session basket, the basket of the registered customer's previous session is restored. Otherwise, the current session basket becomes the basket of the customer and the previous basket is provided through the API.

  3. Enter the Basket Lifetime for both registered and unregistered customers.

    This is the duration of the lifetime in minutes after the basket was last touched by the customer.

    The default is 240 minutes, or four hours. A basket can persist for more than a day. The maximum basket persistence value for registered customers is 1000000000000000000000000000000000000000000 minutes, but this isn't recommended. The maximum basket persistence value for unregistered customers is 10080 minutes, or seven days. The basket lifetime for unregistered customers cannot exceed the basket lifetime for registered customers.

    The basket lifetime value must not exceed the Maximum Basket Lifetime quote value. The default quota value is 1 year (525600 minutes).

    Regardless of the lifetime, payment information is automatically deleted from a basket after seven days.

  4. Specify the Add Product behavior.
    This is how you want new products added to the basket.
    Note: For option products and product bundles containing variation masters, the system creates a new product line item regardless of the site preference.
    • Disallow repeats: If a product that is already in the basket and is added again to the basket, B2C Commerce ignores the request.
    • Increment quantity: B2C Commerce increments the quantity of an existing product line item if the same product is added again.
    • Allow repeated items: B2C Commerce creates a new product line item for each product added to the basket, no matter if the product is already in the basket.
  5. Specify the maximum number of product line items.
    This limits how many items are allowed in the cart at one time. The default is 50. When this limit is reached, B2C Commerce doesn't let more items be added to the cart and will show an error message.
    Bonus products are not counted toward the product line item count when determining if a basket exceeds this site preference.
    The number of independent and dependent product line items combined must not exceed the Product Line Items per Basket quota .
  6. Click Apply to accept your changes.