How to put product price into "add to cart" button ?

Highlighted
New Member
4 0 0

Hi everybody,

 

I'm currently using "Narrative" theme for my website. I thinking that I should add the product price to the ADD TO CART button , rather than having it located below the product title.

 

I just wondering if anyone know how to do this ? Please help me out. Thanks for any and all suggestions.

Here is my product-template.liquid file : https://gist.github.com/huyhoang26/c8cf9fcf42b6684b8247c92597b944d4.js

 

Screen Shot 2020-02-18 at 2.42.59 am.png

0 Likes
Highlighted
Trailblazer
175 26 28

Your files is not readable. Can you please contact me personally? I will change in your code and let you know.

Still not satisfied!!! contact me
Is it good solution? Yes, please Like.
0 Likes
Highlighted
Shopify Expert
2930 499 673

Hi @huyhoang26 

You can do this by section->product-template.liquid file.

Find name="add" (its your add to cart button) then add simple bellow code

{{product.selected_or_first_available_variant.price}}

So it look like:

 <button type="submit" name="add">
    add to cart - {{product.selected_or_first_available_variant.price}}
</button>

Note: its just demo, not exact code , your button code different base on theme.

 

Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com
Skype: jasoliya.brijesh
Want to get Free review and advice for sale on store ?? just text me here
0 Likes
Highlighted
New Member
4 0 0

I'm so sorry that I'm pretty new here so I don't know how to message you privately. Here is my file : https://bit.ly/2V4UXTh . Thank you so much.

0 Likes
New Member
4 0 0

Hi Jasoliya,

 

I'm very appreciate your help. I just can not find "add to cart" in my "product-templete.liquid" file. 

In my "product-templete.liquid" file this is the code for "add to cart" button. Do you have any ideal with that ? Thank you so much for your help.

 

<div class="product__form-container2">

<meta itemprop="price" content="{{ current_variant.price | divided_by: 100.00 }}">
<meta itemprop="priceCurrency" content="{{ shop.currency }}">

<link itemprop="availability" href="http://schema.org/{% if current_variant.available %}InStock{% else %}OutOfStock{% endif %}">
{% include 'product-form' %}

</div>
0 Likes