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!

Chào ! Bạn thấy nội dung này thế nào?