Faster Add-to-Cart impact on custom cart components
Key Takeaway
When Faster Add-to-Cart is enabled, a custom component can't rely on the add-to-cart response for cart item IDs, cart item prices, or promotions. Read cart item IDs from CartItemsAdapter and promotions from CartPromotionsAdapter.
Faster Add-to-Cart is a setting that speeds up shopping in an LWR store by splitting processing time across the Product and Cart pages. The Product page responds faster when a shopper adds an item to the cart, but the add-to-cart response can't be counted on for some cart details. Custom components that expect those details may need to change.
What custom components can't rely on
Because processing time is split across the Product and Cart pages, custom components that use cart APIs must not rely on the add-to-cart response to return cart item IDs, cart item prices, or promotions. Here are examples of these values in the Cart Item response:
- Cart item ID:
cartItemId, the ID of the item - Cart item prices:
salesPriceandtotalPrice - Promotions:
itemizedAdjustmentAmount, the item's adjustment amount, including promotions
When Faster Add-to-Cart is enabled, the response can't be relied on to return the cart item ID, so code that depends on that ID, such as code that opens an editor for the new item, stops working.
If a component relies on the response for any of these values, change the component before you enable Faster Add-to-Cart.