Add to Cart / Pre Order button text, based on inventory level (Momentum v.3)

Add to Cart / Pre Order button text, based on inventory level (Momentum v.3)

override13
Shopify Partner
1 0 0

Hi,

 

I've done a bit of digging through other solutions but haven't found anything quite like I think I'm looking for...

I'm working on a site using Momentum v3. All product are "continue selling when out of stock". I want to set it up so that when stock qty is 0, the add to cart button says 'pre order', and if the stock qty is 1 or more, the button says 'add to cart' as per the existing setup.

Has anyone else managed to achieve this?

Reply 1 (1)

ThePrimeWeb
Shopify Partner
2138 615 497

You should be able to do a Liquid code in the product template that has the add to cart button.
keep in mind the code below is an example because I do not have access to the Momentum theme's code. If you can find it, you should try to amend it or paste it here and I can help you out. 

{% if product.available %}
     <button>Add to cart</button>
{% else %}
     <button>Pre-order</button>
{% endif %}

 

Was I helpful?

Buy me a coffee

🙂

Need help with your store? contact@theprimeweb.com or check out the website
Check out our interview with Shopify!