woocommerce_pay_order_product_in_stock
Filters whether or not the product is in stock for this pay for order.
Usage
add_filter( 'woocommerce_pay_order_product_in_stock', 'wp_kama_woocommerce_pay_order_product_in_stock_filter', 10, 3 ); /** * Function for `woocommerce_pay_order_product_in_stock` filter-hook. * * @param boolean $is_in_stock True if in stock. * @param \WC_Product $product Product. * @param \WC_Order $order Order. * * @return boolean */ function wp_kama_woocommerce_pay_order_product_in_stock_filter( $is_in_stock, $product, $order ){ // filter... return $is_in_stock; }
- $is_in_stock(true|false)
- True if in stock.
- $product(\WC_Product)
- Product.
- $order(\WC_Order)
- Order.
Changelog
Since 9.8.0 | Introduced. |
Since 9.8.0 | -dev |
Where the hook is called
woocommerce_pay_order_product_in_stock
woocommerce_pay_order_product_in_stock
woocommerce/src/StoreApi/Utilities/OrderController.php 626
if ( ! apply_filters( 'woocommerce_pay_order_product_in_stock', $product->is_in_stock(), $product, $order ) ) {
woocommerce/includes/shortcodes/class-wc-shortcode-checkout.php 153
if ( ! apply_filters( 'woocommerce_pay_order_product_in_stock', $product->is_in_stock(), $product, $order ) ) {