Display custom product price using metafields in product, cart and checkout pages

Display custom product price using metafields in product, cart and checkout pages

SriLakshmiG
Tourist
5 0 3

Hi,

 

I've created meta fields for products with custom prices using metafield guru app. I want to display the custom product price using metafields on the product page and when a product is added to the cart this custom price needs to be displayed in cart and checkout pages.

 

Any help pointing in the right direction would be appreciated. 

Replies 3 (3)

chipkeyes88
Shopify Partner
14 3 13

Can you share how you're adding line items to your cart? The cart and subsequently checkout will obtain the price for each line item from the payload that you use to create the line item. So if you want to use a custom price from the metafield, you'll have to use that when you add the line item to the cart. If you share a little more of the code that's creating the cart I can offer more guidance.

SriLakshmiG
Tourist
5 0 3

Thanks for the response.

 

I'm new to the Shopify code customizations. I haven't added any line items code to the cart. I tried to use the existing product template and cart template code.

 

How can I customize the product price in the product/cart page using meta fields?

KenBot
Tourist
7 1 0

I also have this question.

For my shop I used the solution here to create properties field that are selectable (I was really after dropdown menus, but I'm using the entire snippet). I want to sell handmade items that can be made of varying sizes. I also want to change the price of the item based on what is selected when a user clicks submit (eg: A customer wants a tunic with sleeves, a new property is added called sleeve with a value of "3/4" or "full"). 

To make it fun, I'm also using ajax cart. I think I read somewhere that can make this a bit more difficult.