I came across a weird situation with draft orders and checkout extensions.
If a draft order has predefined shipping from admin, extensions on the checkout page made from such draft order are not able to use applyAttributeChange despite instructions.attributes.canUpdateAttributes being true. Using applyAttributeChange causes a rendered of the extension.
This does not affect draft orders with no predefined shipping (ie when the customer chooses their shipping method in checkout).
1 Like
Hey @Adam_Charvat,
What you’re hitting is more of a feature of draft orders themselves rather than checkout extensions. When draft orders have predefined shipping rates they do not allow the changing of shipping addresses at checkout. This is to prevent unexpected shipping costs to merchants.
The workaround (as you’ve found) is to create your draft orders without predefined shipping rates, letting customers choose their shipping method at checkout instead.
Thanks for looking into this.
The problem I described is not that the shipping address cannot be changed, I understand that.
I see the problem with cart attributes which cannot be changed despite instructions.attributes.canUpdateAttributes returning true.
I would expect either for cart attributes updates to work or for cart instructions (canUpdateAttributes) to return false.
Currently, when attempting to update cart attributes using a checkout extension, the extension fails and reloads.
Thanks for the clarification Adam. I’m looking further in to this and will report back what I find.
Hey Kyle, just to let you know the issue still persists.
I have just experienced a draft order with preselected shipping where instructions returned canUpdateAttributes true and canSetCartMetafields true, but when attempting the update, an error reloaded the extension as I described before.
Hey @Adam_Charvat,
In our testing here, we haven’t been able to replicate, except for on a page reload.
We are going to need a little more information to reproduce. I’ll send you a DM right away.