When 3 products are added to the cart, then a Cart Transform function merges them into one and lastly a Product Discount function applies a percentage discount (I have not tried any other discount type) on 2 of those 3 products, everything works correctly and the /cart.js
returns the correct payload with the line item having the has_components
flag to true
, as expected.
The odd behaviour happens when we then send a /cart/change.js
request for that line item to increase its quantity, where two things can happen that depend on the payload of the request:
- If we include the existing properties of the item in the payload like this:
Then we get back a response where the{ "quantity": 2, "id": "123123123123:1c9d2b7bad3e289b04cca549c9d6b061", "properties": { "bundle": "Amazing bundle name" } }
items
property is an array with the 3 separate products instead of one merged line item withhas_components: true
. - If we DO NOT include the existing properties of the item in the payload like this:
Then we get back that one line merged line item as expected, but it does not have the{ "quantity": 2, "id": "123123123123:1c9d2b7bad3e289b04cca549c9d6b061" }
has_components: true
flag.
In both cases, if we refresh the page the /cart.js
endpoint then returns only the expected merged line item with the discount with the correct has_components: true
flag.
Is this expected somehow or is it a bug?