• Customer

    Stock Qty Code

    Posted by: tekguard Aug 13, 2019 at 21:20 (11 months ago)
    Hi Mate,

    Thought I would share this PHP code that shows the available stock.

    Works out pretty good with Techone with the locations of.

    See attached.

    add_action('woocommerce_after_shop_loop_item','bbloomer_show_stock_shop', 10);

    function bbloomer_show_stock_shop() {
    global $product;
    if ( $product->stock ) { // if manage stock is enabled
    if ( number_format( $product->stock,0,'','' ) < 3 ) { // if stock is low
    echo 'Only ' . number_format($product->stock,0,'','') . ' left in stock!';
    } else {
    echo '' . number_format($product->stock,0,'','') . ' left in stock';

  • Customer

    Posted by: yame, Aug 14, 2019 at 10:04 (11 months ago)

    Hi mate,

    Excuse me, we do not get what you mean. Could you please explain for your intention? Then my coder will check for you

  • Customer

    Posted by: tekguard, Aug 14, 2019 at 16:58 (11 months ago)

    I was just sharing the code with you is all.

    It adds a show available stock quantity to the theme.

  • Manager

    Posted by: yame, Aug 15, 2019 at 08:03 (11 months ago)

    Oh yeah. Thank you :D I will ask the coder to refer this

    So if you have any questions, pls let me know



We offer service for $29. If you would like to use it, please click here to provide your credential information.


Use our expert service to turn your ideas into reality. Click here to provide your needed information.


Our support service works from Monday to Friday.
Mean time (GMT +7):
+ 7:30 - 11:30 AM
+ 1:30 - 5:30 PM
We will try to answer all the questions within 24 hours and solve them as quickly as possible