Have your say in Community Polls: What was/is your greatest motivation to start your own business?

Re: Calling the Shopify API from themes liquid code

Calling the Shopify API from themes liquid code

StuartMc
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)

Jason
Shopify Partner
11206 226 2315

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. http://freakdesign.com.au ★