Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Mutate product metafield in checkout ui extension

Mutate product metafield in checkout ui extension

AH63935
Shopify Partner
35 1 27

I am using a checkout ui extension currently. Is it possible to mutate a product metafield in it? I want to mutate the product metafield and store a new price that is needed because I can only query metaobjects from checkout ui extension and not functions (to my current knowledge) and will need to pass that to the cart transformer function. Thanks!

Reply 1 (1)

Liam
Community Manager
3108 344 899

Hi AH63935,

 

What’s the ultimate goal and full use case you're trying to achieve here, and how do metaobjects function within this? Would it be possible to use cart attributes instead of product metafields if this needs to happen at runtime? 

 

Cart attributes in Shopify are custom attributes left by the customer to the merchant, either in their cart or during checkout. These attributes consist of key-value pairs where the key is the name of the attribute and the value is the attribute value. They can be used to store additional information about the cart, such as special instructions or preferences, and can be updated using the Shopify API.

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