Calling the Shopify API from themes liquid code

Shopify Partner
2 0 0

Is it possible to change the price of a product when it’s added to the cart by using the shopify API in the liquid code?  we have some customers that have a custom meta field set. If that is set then I can display a different price that is stored in a custom product meta field. But I can’t make the check out process use that price. 

I’ve tried using discounts but there are problems using that method. 

so I’m hoping to be able to make a custom API call to add the product with a different price. 

Reply 1 (1)

Shopify Expert
11196 226 2287

Liquid is a front end templating language, so you could emulate a different price, but it doesn't change the price. Looks like you've already figured that part out. So to change the price based on a metafield you'd be looking at things like Functions or the Cart Transform API

★ I jump on these forums in my free time to help and share some insights. Not looking to be hired, and not looking for work. ★