woocommerce_pay_order_product_in_stock хук-фильтрWC 9.8.0

Filters whether or not the product is in stock for this pay for order.

Использование

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.

Список изменений

С версии 9.8.0 Введена.
С версии 9.8.0 -dev

Где вызывается хук

OrderController::get_failed_order_stock_error()
woocommerce_pay_order_product_in_stock
WC_Shortcode_Checkout::order_pay()
woocommerce_pay_order_product_in_stock
woocommerce/src/StoreApi/Utilities/OrderController.php 638
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 ) ) {

Где используется хук в WooCommerce

Использование не найдено.