Hello, I want to add the product price into the add to cart button across all add to cart buttons on my site. How do I do this?
Topic summary
A user wants to display product prices directly within “Add to Cart” buttons across their entire Shopify store.
Initial Guidance:
- Requires editing theme files to insert Liquid price code (
{{ product.price }}) into button elements - One responder suggests hiring a developer due to complexity
Technical Solution Provided:
- Use
{{ product.price | money }}for standard products - Use
{{ product.selected_or_first_available_variant.price | money }}for products with variants - Target files like
main-product.liquidorproduct-card.liquid - Format example: “Add to Cart – $XX.XX”
Current Status:
The user confirmed they attempted implementation but couldn’t locate the correct code section. A detailed solution with specific Liquid syntax and file locations has been provided, with an offer to help implement dynamic price updates for variant selections. The issue remains unresolved pending user implementation.
Hey @kirsten11123
For that you will have to edit the add to cart code from your theme files and add the price code in the button, the price code should look something like this:
{{ product.price }}
This will require some complex changes in your theme files so if you’re not familiar with coding then I would highly recommend you to hire a Shopify developer who can help out with that. If you want me to help with this then feel free to connect with me and I would be more than happy to give a helping hand.
Best Regards,
Moeed
Hello! This is what I was trying to do, but I couldn’t find the appropriate section in the code to do it. Can you provide me with a bit more guidance as to where I should look for it?
Hey @kirsten11123 ,
To show the product price in all “Add to Cart” buttons, update your button code like this:
Add to Cart – {{ product.price | money }}
For variants, use:
Add to Cart – {{ product.selected_or_first_available_variant.price | money }}
Edit this in files like main-product.liquid or product-card.liquid. Let me know if you need it to update dynamically with variant changes.
Best Regards,
Rajat
Shopify Expert