For discussing the development and usage of Checkout UI extensions, post-purchase extensions, web pixels, Customer Accounts UI extensions, and POS UI extensions
Following the cart transform documentation https://shopify.dev/docs/api/functions/reference/cart-transform
I was trying to have update operation get going, but I am getting error for adding "price" parameter in Input
As per documentation, update operation does accept price,title,image etc kind of data https://shopify.dev/docs/api/functions/reference/cart-transform#example-update-operation
But to me its giving me error
Any idea why that is ?
{
"path": [
"operations",
0,
"update",
"price"
],
"explanation": "Field is not defined on UpdateOperation"
}
Hi Siddhant,
Just to confirm - are you attempting this of a dev store or Plus store? Is your operation the same as the one in this example?
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Hi @Liam , Yes I can confirm that I have tried to do this on Dev store and Plus store
posting the output details and error
{
"operations": [
{
"update": {
"cartLineId": "gid://shopify/CartLine/af289e2f-bf8f-4313-a83e-2edc0876ef69",
"title": "blue sunset from extension",
"price": {
"adjustment": {
"fixedPricePerUnit": {
"amount": "0"
}
}
}
}
},
{
"update": {
"cartLineId": "gid://shopify/CartLine/d0f5bffd-5911-4c11-b399-adacbe5331ed",
"title": "The Summer And Frost Bundle from extension",
"price": {
"adjustment": {
"fixedPricePerUnit": {
"amount": "0"
}
}
}
}
}
]
}
Error
[
{
"path": [
"operations",
0,
"update",
"price"
],
"explanation": "Field is not defined on UpdateOperation"
},
{
"path": [
"operations",
1,
"update",
"price"
],
"explanation": "Field is not defined on UpdateOperation"
}
]
Hi again Siddhant,
If you try to update something else other than the price (eg: image) can you complete this update operation?
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Hey @Liam , yes I did try to run update operation with just title , it seems to be working with only title, but when I add price, it gives error