We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

How to Use Cart Transform API to Set Product Price from Metafield

How to Use Cart Transform API to Set Product Price from Metafield

greeshma
Shopify Partner
33 2 8

Hi,

 

I want to change the product price when it is added to the cart, so that the cart displays the price from a metafield defined on the product. I’m using the Cart Transform API to achieve this.

I have already:

  • Installed the Cart Transform extension in my custom app.

  • Added the read_cart_transforms and write_cart_transforms access scopes.

However, I’m unsure how to configure the run.graphql and run.js files to fetch the metafield value and update the cart line item price accordingly.

Can someone guide me on what exactly needs to be added to these files to achieve this functionality?

Replies 0 (0)