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

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?

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 %}
     
{% else %}
     
{% endif %}