Set all products instock without edit manual in Woocommerce
Maybe you got problem with stock when feed your product to your website or to platform for ads.
This snippet PHP will help you set all products instock without edit them.
Put snippet below in to your functions.php file the make it works
1 2 3 4 5 6 7 8 9 | add_filter( 'woocommerce_product_get_stock_status', 'hvm_product_get_stock_status', 99, 2 ); add_filter( 'woocommerce_product_variation_get_stock_status', 'hvm_product_get_stock_status', 99, 2 ); function hvm_product_get_stock_status( $value='', $obj ) { return 'instock'; } add_filter('woocommerce_product_is_in_stock', 'hvm_woocommerce_product_is_in_stock' ); function hvm_woocommerce_product_is_in_stock( ) { return true; } |
Good luck!
Copyright protected by Digiprove © 2023Chào ! Bạn thấy nội dung này thế nào?
Fantastic site. Lots of helpful information here. I am sending it to some friends ans additionally sharing in delicious. And of course, thanks for your effort!
Love this blog! The content is always so relevant and insightful, keep up the great work!