Re: Put price in add to cart button product page mobile

Put price in add to cart button product page mobile

PRETTYFRIDAYS
Pathfinder
197 0 35

Hey, ive tried so many times to put the price in the add to cart button for mobile only but nothing seems to work! Does anyone happen to know how to do this? thanks in advance for helping me out! I will put a example down below!

TASTE THEME

LINK:https://e8aaa0-3.myshopify.com/password

PASSWORD: mohwhiImage 26-12-2023 at 15.45.jpeg

 

Replies 5 (5)

Jasoliya
Shopify Partner
4823 625 1225

Hi @PRETTYFRIDAYS 

try to follow this

- Shopify admin, go to "Online Store" > "Themes."

- find for section product.liquid or product-template.liquid

- then find for "name="add" which is add to cart button

- then add price like this 

 

<button type="submit" name="add" id="AddToCart" class="btn">
   Add to Cart - {{ product.price | money }}
</button>

 

Note: here {{ product.price | money }} will used to add price in button 

Want custom changes? hire me.
3 months of Shopify for $1/month. Look here.
Email us Or WhatsApp, Try our Free app for product bundles and Codify Order Cancel or Order edit
Want to get Free review and advice for sale on store ?? just text me here
PRETTYFRIDAYS
Pathfinder
197 0 35

Hey, I don't have a product liquid I use the taste theme, can't this be done using css?

Huptech-Web
Shopify Partner
1025 205 220

Hello @PRETTYFRIDAYS ,

 

Replace the below code in your "buy-button.liquid

 

{{ 'products.product.add_to_cart' | t }} - {{ product.price | money }}

 

image.png

If you found this response helpful, please do like and accept the solution. Thanks!
Need support with Customizing your Shopify store?
Feel free to contact me at info@huptechweb.com or Visit our website Huptech Web.
Instant Shortcode Builder: Integrate customizable UI features anywhere in your store - No coding knowledge required
PRETTYFRIDAYS
Pathfinder
197 0 35

Hey, it works! But unfortunately on both desktop and mobile. Do you know how I can make it mobile only? Thanks!

manusam
New Member
7 0 0

I was looking for something like this but that would work on both single priced products and products with attributes. Any idea how to make it work? Thanks!