Shopify / dawn

Shopify's first source available reference theme, with Online Store 2.0 features and performance built-in.
Other
2.54k stars 3.44k forks source link

Ajax Cart API response item_count bug on cart/change request #3624

Open zachmdev opened 1 month ago

zachmdev commented 1 month ago

Describe the current behavior

With a bundle product in the cart, if we change its quantity, or another product's quantity, or simply remove a product from the cart, the response we get from the Ajax Cart API has the wrong item_count value. If you compare item_count and items on the screenshot, it doesn't match.

Describe the expected behavior

The bundle product should count as one product and not as the sum of the products it is composed by.

Version information (Dawn, browsers and operating systems)

Possible solution

We might "bypass" this using the Section rendering API to render the cart.item_count instead of rendering it with Javascript, but this should be fixed anyway.

Additional context/screenshots

This issue is related to that one: https://github.com/Shopify/dawn/issues/2994#issuecomment-1884175944

Image