codehaven - php snippets - coding help
Generic filters
Exact matches only
  • Add how many left in stock on products stock controlled only – Woocommerce

    21st January 2021


    woocommerce category codehaven

    I have 3 products in woocommerce that I wish to sell and show how many left in stock for each one. The rest of the website is not stock controlled.
    I do not want to show a label that says 745 in stock or whatever for all of them as they are always in stock. Just the clearance or on sale items in my one and only page.
    The code below achieves this.

    Add the code to the functions.php

    With thanks to this site for this great code

    Was this code snippet helpful?