How to get woocommerce inventory status [closed]


In a woocommerce theme, Im trying to show a warning when product is out of stock. Something like this:

<?php if ('this_product_is_out_of_stock'): ?>
    <p>This product is out of stock. It can be purchased by custom made order.</p>
<?php endif; ?>

Is there a function to say ‘this_product_is_out_of_stock’ or some other way to achieve it?

I was searching woocommerce api docs unsuccesfully:

Thank you in advance.

aitor 4 months 0 Answers 8 views 0

Leave an answer