• Customer

    Stock Qty Code

    Posted by: tekguard Aug 13, 2019 at 21:20 (5 year 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 (5 year 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

    Regards,
    Yame
  • Customer

    Posted by: tekguard, Aug 14, 2019 at 16:58 (5 year ago)

    I was just sharing the code with you is all.

    It adds a show available stock quantity to the theme.

    Regards....
  • Manager

    Posted by: yame, Aug 15, 2019 at 08:03 (5 year ago)

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

    So if you have any questions, pls let me know

    Yame

INSTALLATION SERVICE

Theme Installation: $49. Pay now

CUSTOMIZED SERVICES

Use our expert service to turn your ideas into reality. Please send an email to kutethemes@gmail.com to provide the more detailed information. Thanks!

WORKING TIME

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