{"id":69011,"date":"2016-04-20T07:45:35","date_gmt":"2016-04-20T11:45:35","guid":{"rendered":"http:\/\/www.templatemonster.com\/help\/?p=69011"},"modified":"2016-05-23T04:22:19","modified_gmt":"2016-05-23T08:22:19","slug":"woocommerce-how-to-change-in-stock-out-of-stock-text-displayed-on-a-product-page","status":"publish","type":"post","link":"https:\/\/www.templatemonster.com\/help\/woocommerce-how-to-change-in-stock-out-of-stock-text-displayed-on-a-product-page.html","title":{"rendered":"WooCommerce. How to change &#8216;In Stock&#8217; \/ &#8216;Out of Stock&#8217; text displayed on a product page"},"content":{"rendered":"<p>This tutorial will show how to <strong>change &#8216;In Stock&#8217; \/ &#8216;Out of Stock&#8217; text displayed on a product page<\/strong> in <strong>WooCommerce templates<\/strong>.<\/p>\r\n<a href=\"http:\/\/www.youtube.com\/watch?v=SJIOu2xmi_4?width=1280&amp;height=720\" rel=\"prettyPhoto\">WooCommerce. How to change &#8216;In Stock&#8217; \/ &#8216;Out of Stock&#8217; text displayed on a product page<\/a>\r\n<ol>\r\n\t<li>\r\n\t <p>Log into WordPress admin panel, navigate to <strong>Appearance<\/strong> -> <strong>Editor<\/strong> tab and open <strong>custom-functions.php<\/strong> file for editing:<\/p> \r\n\t <a href=\"\/help\/wp-content\/uploads\/2016\/04\/WooCommerce.-How-to-Change-In-Stock-Out-of-Stock-text-displayed-on-a-products-page-1.png\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2016\/04\/WooCommerce.-How-to-Change-In-Stock-Out-of-Stock-text-displayed-on-a-products-page-1-300x162.png\" alt=\"WooCommerce. How to Change &#039;In Stock&#039;  &#039;Out of Stock&#039; text displayed on a product&#039;s page -1\" width=\"300\" height=\"162\" class=\"alignnone size-medium wp-image-69012\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2016\/04\/WooCommerce.-How-to-Change-In-Stock-Out-of-Stock-text-displayed-on-a-products-page-1-300x162.png 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2016\/04\/WooCommerce.-How-to-Change-In-Stock-Out-of-Stock-text-displayed-on-a-products-page-1-150x81.png 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2016\/04\/WooCommerce.-How-to-Change-In-Stock-Out-of-Stock-text-displayed-on-a-products-page-1-1024x555.png 1024w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2016\/04\/WooCommerce.-How-to-Change-In-Stock-Out-of-Stock-text-displayed-on-a-products-page-1.png 1287w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n\t<\/li> \r\n\t\r\n\t<li>\r\n\t <p>Add the following code to the bottom of <strong>custom-functions.php<\/strong> file. You can change the Available! and Sold Out text to be whatever you like:<\/p>\r\n<pre class=\"brush:php\">\r\nadd_filter( 'woocommerce_get_availability', 'wcs_custom_get_availability', 1, 2);\r\nfunction wcs_custom_get_availability( $availability, $_product ) {\r\n   \r\n   \t\/\/ Change In Stock Text\r\n    if ( $_product->is_in_stock() ) {\r\n        $availability['availability'] = __('Available!', 'woocommerce');\r\n    }\r\n    \/\/ Change Out of Stock Text\r\n    if ( ! $_product->is_in_stock() ) {\r\n    \t$availability['availability'] = __('Sold Out', 'woocommerce');\r\n    }\r\n    return $availability;\r\n}\r\n<\/pre>\r\n\t <a href=\"\/help\/wp-content\/uploads\/2016\/04\/WooCommerce.-How-to-Change-In-Stock-Out-of-Stock-text-displayed-on-a-products-page-2.png\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2016\/04\/WooCommerce.-How-to-Change-In-Stock-Out-of-Stock-text-displayed-on-a-products-page-2-300x196.png\" alt=\"WooCommerce. How to Change &#039;In Stock&#039;  &#039;Out of Stock&#039; text displayed on a product&#039;s page -2\" width=\"300\" height=\"196\" class=\"alignnone size-medium wp-image-69013\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2016\/04\/WooCommerce.-How-to-Change-In-Stock-Out-of-Stock-text-displayed-on-a-products-page-2-300x196.png 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2016\/04\/WooCommerce.-How-to-Change-In-Stock-Out-of-Stock-text-displayed-on-a-products-page-2-150x98.png 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2016\/04\/WooCommerce.-How-to-Change-In-Stock-Out-of-Stock-text-displayed-on-a-products-page-2-1024x670.png 1024w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2016\/04\/WooCommerce.-How-to-Change-In-Stock-Out-of-Stock-text-displayed-on-a-products-page-2.png 1066w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a> \r\n\t<\/li>\r\n\t<li>\r\n   <p>Go to your site to check Product pages, make sure to refresh the page:<\/p> \r\n   <a href=\"\/help\/wp-content\/uploads\/2016\/04\/WooCommerce.-How-to-Change-In-Stock-Out-of-Stock-text-displayed-on-a-products-page-3.png\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2016\/04\/WooCommerce.-How-to-Change-In-Stock-Out-of-Stock-text-displayed-on-a-products-page-3-300x155.png\" alt=\"WooCommerce. How to Change &#039;In Stock&#039;  &#039;Out of Stock&#039; text displayed on a product&#039;s page -3\" width=\"300\" height=\"155\" class=\"alignnone size-medium wp-image-69014\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2016\/04\/WooCommerce.-How-to-Change-In-Stock-Out-of-Stock-text-displayed-on-a-products-page-3-300x155.png 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2016\/04\/WooCommerce.-How-to-Change-In-Stock-Out-of-Stock-text-displayed-on-a-products-page-3-150x77.png 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2016\/04\/WooCommerce.-How-to-Change-In-Stock-Out-of-Stock-text-displayed-on-a-products-page-3-1024x527.png 1024w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2016\/04\/WooCommerce.-How-to-Change-In-Stock-Out-of-Stock-text-displayed-on-a-products-page-3.png 1266w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n  <a href=\"\/help\/wp-content\/uploads\/2016\/04\/WooCommerce.-How-to-Change-In-Stock-Out-of-Stock-text-displayed-on-a-products-page-4.png\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2016\/04\/WooCommerce.-How-to-Change-In-Stock-Out-of-Stock-text-displayed-on-a-products-page-4-300x158.png\" alt=\"WooCommerce. How to Change &#039;In Stock&#039;  &#039;Out of Stock&#039; text displayed on a product&#039;s page -4\" width=\"300\" height=\"158\" class=\"alignnone size-medium wp-image-69015\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2016\/04\/WooCommerce.-How-to-Change-In-Stock-Out-of-Stock-text-displayed-on-a-products-page-4-300x158.png 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2016\/04\/WooCommerce.-How-to-Change-In-Stock-Out-of-Stock-text-displayed-on-a-products-page-4-150x79.png 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2016\/04\/WooCommerce.-How-to-Change-In-Stock-Out-of-Stock-text-displayed-on-a-products-page-4-1024x539.png 1024w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2016\/04\/WooCommerce.-How-to-Change-In-Stock-Out-of-Stock-text-displayed-on-a-products-page-4.png 1267w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n      <\/li>\r\n\t<\/ol>\r\n<p>Feel free to check the detailed video tutorial bellow:<\/p>\r\n<a href=\"http:\/\/www.youtube.com\/watch?v=SJIOu2xmi_4?width=1280&amp;height=720\" rel=\"prettyPhoto\">WooCommerce. How to change &#8216;In Stock&#8217; \/ &#8216;Out of Stock&#8217; text displayed on a product page<\/a>","protected":false},"excerpt":{"rendered":"<p>This tutorial will show how to <strong>change &#8216;In Stock&#8217; \/ &#8216;Out of Stock&#8217; text displayed on a product page<\/strong> in <strong>WooCommerce templates<\/strong>.<\/p>\n","protected":false},"author":73,"featured_media":69018,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1556],"tags":[2248,1810,2418],"_links":{"self":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/69011"}],"collection":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/users\/73"}],"replies":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/comments?post=69011"}],"version-history":[{"count":0,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/69011\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media\/69018"}],"wp:attachment":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media?parent=69011"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/categories?post=69011"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/tags?post=69011"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}