Debut - "Price on Request" and ".. items left in stock"

Tourist
5 0 1

1; I'd like to add some products to a store with 0.00 price, but instead of €0.00 I'd like it to say "Price on Request" (or something similar" on product and collection pages.

There are still other products with prices, so I only need to find the ones with 0.00 and do "price on request" on them.


2; I'd like to add ".. products left in stock" message above the add to cart button on product pages, it doesn't have to be dynamically updated, should be enough if it shows how many items are left in stock at the time of loading the page.

Could anyone help with the code for this?

store:  ilvinaio.myshopify.com
pass.:  teaclo

Thank you

0 Likes
Highlighted
Shopify Partner
1083 221 285

Hello,

1) You can set price 0.00 from product settings but the other thing you are looking for need an app or custom code. 
I can share logic but for code you have to hire someone. Make a if condition in product price and when you find it's 0 show text 'Price on Request' else leave it as it is.

2) For this you can use this code but this will work if you have only on variant.

{% for variant in product.variants %}
    <p>Only {{ variant.inventory_quantity }} left in stock.</p>
    {% endfor %}

To make it fully functional with multiple variant you have to write a callback function which will update stock every-time when variant changes.

Thanks 

Want to modify or custom changes on store hire me.
My Email: guleriathakur43@gmail.com
Skype: navrocks1
If helpful then please Like and Accept Solution.
If you are happy and want to donate small Click here (Its my paypal)
0 Likes
Highlighted
Tourist
5 0 1

2; The code works, however, on product pages with multiple variants the "Only .. left in stock" message gets displayed 4 times. Do you know why this could be?

Thank you

0 Likes