Hello, welcome to therichpost.com. In this post, I will tell you Woocommerce Product Is In Stock Hook. WordPress is the best cms and Woocommerce is the best Ecommerce plugin. WordPress hooks(add_action, add_filter) give us the power to edit or change the code without interruption into the files and this is the best thing about wordpress. Now I am going to tell you how the hooks work.
Woocommerce Product Is In Stock Hook will be useful when we need to stop to purchase that product which is in stock or you can use this in some condition.
After Hook:
Before Hook:
Here is the working and testing code for Woocommerce Product Is In Stock Hook and you need to add this into your theme’s functions.php file:
add_filter(‘woocommerce_product_is_in_stock’, ‘woocommerce_product_is_in_stock’ );
function woocommerce_product_is_in_stock( ) {
return false;
}
There are so many hooks in woocommerce and i will let you know all. Please do comment if you any query related to this post. Thank you. Therichpost.com
Leave a Reply