It possible to send value to metafield order when purchase with liquid

nerya
Visitor
2 0 0

Hi,

I'm trying to add some value to metafield order, when someone do purchases (thank you page), 

I prefer not to use API for this, only with Liquid

Is it possible?

 

Thanks

Replies 2 (2)
EcomGraduates
Shopify Partner
588 48 73

Hello there  

 

Unfortunately, it is not possible to modify metafields on the thank you page using only Liquid. This is because Liquid is a templating language that only affects the output of a page and does not have any access to the Shopify database or the API.

To modify a metafield on the thank you page, you will need to use the Shopify API or an app that provides this functionality. Using the Shopify API, you can create a webhook that triggers a script to modify the metafield when an order is created. You can also use an app from the Shopify App Store that provides metafield editing functionality.

 

banned
nerya
Visitor
2 0 0

OK,

so I'm going to use API and make JS requests with HMAC on the checkout page,

Thank you