{"id":4025,"date":"2023-03-07T22:41:17","date_gmt":"2023-03-07T22:41:17","guid":{"rendered":"https:\/\/scriptfeeds.com\/blog\/?p=4025"},"modified":"2025-03-12T16:20:43","modified_gmt":"2025-03-12T16:20:43","slug":"display-stock-availability-at-woocommerce-shop","status":"publish","type":"post","link":"https:\/\/scriptfeeds.com\/blog\/wordpress\/display-stock-availability-at-woocommerce-shop\/","title":{"rendered":"Quickly Display Stock Availability at WooCommerce Shop page 2025"},"content":{"rendered":"\n<p>We use a simple PHP code to display Stock Availability at WooCommerce Shop Availability at <strong><a href=\"http:\/\/woocommerce.com\" data-type=\"URL\" data-id=\"woocommerce.com\" target=\"_blank\" rel=\"noopener\">WooCommerce Shop<\/a><\/strong> 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.<\/p>\n\n\n\n<div class=\"wp-block-rank-math-toc-block\" id=\"rank-math-toc\"><h2>Table of Contents<\/h2><nav><ul><li><a href=\"#strong-below-steps-will-help-you-to-display-stock-availability-at-woo-commerce-shop-and-category-page-strong\">Steps will help you to Display Stock Availability at WooCommerce Shop and Category page<\/a><ul><li><a href=\"#strong-enable-inventory-management-in-woo-commerce-settings-strong\">Enable Inventory Management in WooCommerce Settings<\/a><\/li><li><a href=\"#strong-php-snippet-code-to-add-in-functions-php-file-to-display-stock-quantity-status-strong\">PHP Snippet : Code to add in Functions.php file to display Stock Quantity \/ Status<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n\n\n\n<h2 class=\"has-medium-font-size wp-block-heading\" id=\"strong-below-steps-will-help-you-to-display-stock-availability-at-woo-commerce-shop-and-category-page-strong\"><strong>Below steps will help you to Display Stock Availability at WooCommerce Shop and Category page<\/strong><\/h2>\n\n\n\n<h3 class=\"has-medium-font-size wp-block-heading\" id=\"strong-enable-inventory-management-in-woo-commerce-settings-strong\"><strong>Enable Inventory Management in WooCommerce Settings<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>To enable the Inventory management go to <strong>WooCommerce -&gt; Settings -&gt; Products -&gt; Inventory <\/strong><\/li>\n\n\n\n<li>Enable the Inventory Management and Save the settings.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"has-medium-font-size wp-block-heading\" id=\"strong-php-snippet-code-to-add-in-functions-php-file-to-display-stock-quantity-status-strong\"><strong>PHP Snippet : Code to add in Functions.php file to display Stock Quantity \/ Status<\/strong><\/h3>\n\n\n\n<p>Add below code in functions.php file of child theme<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>add_action( 'woocommerce_after_shop_loop_item', 'scriptfeeds_stock_shop', 10 );\n  \nfunction scriptfeeds_stock_shop() {\n   global $product;\n   echo wc_get_stock_html( $product );\n}<\/code><\/pre>\n\n\n\n<p>After adding and saving the code. Check WooCommerce Product category and Shop pages.<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"800\" height=\"367\" src=\"https:\/\/scriptfeeds.com\/blog\/wp-content\/uploads\/2023\/03\/Display-Stock-Availability-at-WooCommerce-Shop-page-before.jpg\" alt=\"Display-Stock-Availability-at-WooCommerce-Shop-page-before\" class=\"wp-image-4031\" srcset=\"https:\/\/scriptfeeds.com\/blog\/wp-content\/uploads\/2023\/03\/Display-Stock-Availability-at-WooCommerce-Shop-page-before.jpg 800w, https:\/\/scriptfeeds.com\/blog\/wp-content\/uploads\/2023\/03\/Display-Stock-Availability-at-WooCommerce-Shop-page-before-300x138.jpg 300w, https:\/\/scriptfeeds.com\/blog\/wp-content\/uploads\/2023\/03\/Display-Stock-Availability-at-WooCommerce-Shop-page-before-150x69.jpg 150w, https:\/\/scriptfeeds.com\/blog\/wp-content\/uploads\/2023\/03\/Display-Stock-Availability-at-WooCommerce-Shop-page-before-768x352.jpg 768w, https:\/\/scriptfeeds.com\/blog\/wp-content\/uploads\/2023\/03\/Display-Stock-Availability-at-WooCommerce-Shop-page-before-399x183.jpg 399w, https:\/\/scriptfeeds.com\/blog\/wp-content\/uploads\/2023\/03\/Display-Stock-Availability-at-WooCommerce-Shop-page-before-750x344.jpg 750w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption class=\"wp-element-caption\">Before Adding PHP snippet in functions.php file<\/figcaption><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\"><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"800\" height=\"367\" src=\"https:\/\/scriptfeeds.com\/blog\/wp-content\/uploads\/2023\/03\/Display-Stock-Availability-at-WooCommerce-Shop-page.jpg\" alt=\"Display Stock Availability at WooCommerce Shop page\" class=\"wp-image-4029\" srcset=\"https:\/\/scriptfeeds.com\/blog\/wp-content\/uploads\/2023\/03\/Display-Stock-Availability-at-WooCommerce-Shop-page.jpg 800w, https:\/\/scriptfeeds.com\/blog\/wp-content\/uploads\/2023\/03\/Display-Stock-Availability-at-WooCommerce-Shop-page-300x138.jpg 300w, https:\/\/scriptfeeds.com\/blog\/wp-content\/uploads\/2023\/03\/Display-Stock-Availability-at-WooCommerce-Shop-page-150x69.jpg 150w, https:\/\/scriptfeeds.com\/blog\/wp-content\/uploads\/2023\/03\/Display-Stock-Availability-at-WooCommerce-Shop-page-768x352.jpg 768w, https:\/\/scriptfeeds.com\/blog\/wp-content\/uploads\/2023\/03\/Display-Stock-Availability-at-WooCommerce-Shop-page-399x183.jpg 399w, https:\/\/scriptfeeds.com\/blog\/wp-content\/uploads\/2023\/03\/Display-Stock-Availability-at-WooCommerce-Shop-page-750x344.jpg 750w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption class=\"wp-element-caption\">After Adding PHP snippet in functions.php file. It Display Stock Availability at WooCommerce Shop page (Red Marked)<\/figcaption><\/figure>\n<\/div><\/div>\n<\/div>\n\n\n\n<p>So that&#8217;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 <strong><a href=\"https:\/\/scriptfeeds.com\/blog\/hire-us\/\" data-type=\"page\" data-id=\"3537\">Developer Team<\/a><\/strong> for any help.<\/p>\n\n\n\n<p>Happy Coding!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3393,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jnews-multi-image_gallery":[],"jnews_single_post":{"subtitle":"","format":"standard","video":"","gallery":"","source_name":"","source_url":"","via_name":"","via_url":"","override_template":"0","override":[{"template":"2","single_blog_custom":"","parallax":"1","fullscreen":"1","layout":"right-sidebar-narrow","sidebar":"default-sidebar","second_sidebar":"default-sidebar","sticky_sidebar":"1","share_position":"float","share_float_style":"share-monocrhome","show_share_counter":"1","show_view_counter":"1","show_featured":"1","show_post_meta":"1","show_post_author":"1","show_post_author_image":"1","show_post_date":"1","post_date_format":"default","post_date_format_custom":"Y\/m\/d","show_post_category":"1","show_post_reading_time":"0","post_reading_time_wpm":"300","show_zoom_button":"0","zoom_button_out_step":"2","zoom_button_in_step":"3","show_post_tag":"1","show_prev_next_post":"0","show_popup_post":"0","number_popup_post":"1","show_author_box":"0","show_post_related":"1","show_inline_post_related":"0"}],"override_image_size":"0","image_override":[{"single_post_thumbnail_size":"no-crop","single_post_gallery_size":"crop-500"}],"trending_post":"0","trending_post_position":"meta","trending_post_label":"Trending","sponsored_post":"0","sponsored_post_label":"Sponsored by","sponsored_post_name":"","sponsored_post_url":"","sponsored_post_logo_enable":"0","sponsored_post_logo":"","sponsored_post_desc":"","disable_ad":"0"},"jnews_primary_category":{"id":"","hide":""},"footnotes":""},"categories":[285,75],"tags":[286],"class_list":["post-4025","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php-snippet","category-wordpress","tag-how-to-show-stock-status-below-product-grid"],"_links":{"self":[{"href":"https:\/\/scriptfeeds.com\/blog\/wp-json\/wp\/v2\/posts\/4025","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/scriptfeeds.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/scriptfeeds.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/scriptfeeds.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/scriptfeeds.com\/blog\/wp-json\/wp\/v2\/comments?post=4025"}],"version-history":[{"count":0,"href":"https:\/\/scriptfeeds.com\/blog\/wp-json\/wp\/v2\/posts\/4025\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/scriptfeeds.com\/blog\/wp-json\/wp\/v2\/media\/3393"}],"wp:attachment":[{"href":"https:\/\/scriptfeeds.com\/blog\/wp-json\/wp\/v2\/media?parent=4025"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/scriptfeeds.com\/blog\/wp-json\/wp\/v2\/categories?post=4025"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/scriptfeeds.com\/blog\/wp-json\/wp\/v2\/tags?post=4025"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}