• Resolved Kerosity

    (@kerosity)


    I used this code snippet to get the product inventory to show.

    add_action( 'woocommerce_after_shop_loop_item', 'tsss_show_stock_shop', 10 );
      
    function tsss_show_stock_shop() {
       global $product;
       echo wc_get_stock_html( $product );
    }

    On the category page it appears at the bottom of the product.
    On the product page it appears stacked on top of the add-to-cart button.

    What code should I be using to place the product stock numbers where I want them in my template?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How do I change location of the product stock message?’ is closed to new replies.