Scriptfeeds Blog
  • Blog
  • WordPress
    • Woocommerce
    • WordPress Errors
    • WordPress Plugins
  • Development
    • WordPress Themes
  • Hire us
Cart / $0.00

No products in the cart.

No Result
View All Result
Scriptfeeds Blog
  • Blog
  • WordPress
    • Woocommerce
    • WordPress Errors
    • WordPress Plugins
  • Development
    • WordPress Themes
  • Hire us
Cart / $0.00

No products in the cart.

No Result
View All Result
Scriptfeeds Blog
No Result
View All Result
Home Wordpress PHP Snippet

Quickly Display Stock Availability at WooCommerce Shop page 2025

Scriptfeeds by Scriptfeeds
March 7, 2023
in PHP Snippet, Wordpress
0
84
SHARES
Share on FacebookShare on TwitterWhatsapp this Blog

We use a simple PHP code to display Stock Availability at WooCommerce Shop Availability at WooCommerce Shop or category Page. Showing stocks of Product on WooCommerce Shop pages and Category pages helps your customer to navigate easily in store and view only those products which are in stock. Such options helps in quick decision making for customer on online store.

Table of Contents

  • Steps will help you to Display Stock Availability at WooCommerce Shop and Category page
    • Enable Inventory Management in WooCommerce Settings
    • PHP Snippet : Code to add in Functions.php file to display Stock Quantity / Status

Below steps will help you to Display Stock Availability at WooCommerce Shop and Category page

Enable Inventory Management in WooCommerce Settings

  • To enable the Inventory management go to WooCommerce -> Settings -> Products -> Inventory
  • Enable the Inventory Management and Save the settings.

PHP Snippet : Code to add in Functions.php file to display Stock Quantity / Status

Add below code in functions.php file of child theme

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

After adding and saving the code. Check WooCommerce Product category and Shop pages.

Display-Stock-Availability-at-WooCommerce-Shop-page-before
Before Adding PHP snippet in functions.php file
Display Stock Availability at WooCommerce Shop page
After Adding PHP snippet in functions.php file. It Display Stock Availability at WooCommerce Shop page (Red Marked)

So that’s all you need to follow to show or Display Stock Availability at WooCommerce Shop and category page. Give it a try and let us know how it works. You can connect with our Developer Team for any help.

Happy Coding!

Connect with Developer
Loading
Tags: How to show Stock status below Product Grid
Share34Tweet21Send

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

I agree to the Terms & Conditions and Privacy Policy.

Scriptfeeds Blog

© 2022 Scriptfeeds

Blog Categories

  • WordPress
  • Development
  • Reviews
  • Marketing

Connect us on

No Result
View All Result
  • Blog
  • WordPress
    • Woocommerce
    • WordPress Errors
    • WordPress Plugins
  • Development
    • WordPress Themes
  • Hire us

© 2022 Scriptfeeds

This website uses cookies. By continuing to use this website you are giving consent to cookies being used. Visit our Privacy and Cookie Policy.