Short description of issue
Setting ‘can_remove’ and ‘can_update_quantity’ on nested cart items
Reproduction steps
NA
Additional info
Is it possible to set these ‘instructions’ (as they’re called in Liquid) when adding nested cart items via the Cart AJAX API (i.e. /add.js). They always seem to be true - we’d like nested items to NOT be removable or have their quantities updated independent of the ‘parent’ item.
What type of topic is this
Bug report
1 Like
I’m looking for this also.
I tried this payload:
{
“items”: [
{
“id”: 42459973681250,
“quantity”: 1
},
{
“id”: 42439384268898,
“quantity”: 1,
“parent_id”: 42459973681250,
“instructions”: {
“can_update_quantity”: false,
“can_remove”: false
}
}
]
}
No runtime errors, but I can change quantities and remove the child items in the cart. The instructions seems to be ignored.
The response from the call includes:
"instructions":{"can_remove":true,"can_update_quantity":true},"
It appears the instructions are reporting what’s possible, not allowing changes.
So maybe not a bug - but we definitely need a feature that allows nested cart items to be treated in a more logical way if we truly want the parent and children to be a “unit”.
Hi there,
At the moment, these properties are read-only, and as @ambstrat mentioned, reflect what’s possible.
Thanks for reaching out about this. Feedback like this helps us understand which features merchants and developers are looking for. I’ll log this as a feature request on our side, and I’ll follow up here if and when we add support for manipulating those instructions.