woocommerce_cart_product_not_enough_stock_already_in_cart_message хук-фильтрWC 5.3.0

Filters message about product not having enough stock accounting for what's already in the cart.

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

add_filter( 'woocommerce_cart_product_not_enough_stock_already_in_cart_message', 'wp_kama_woocommerce_cart_product_not_enough_stock_already_in_message_filter', 10, 4 );

/**
 * Function for `woocommerce_cart_product_not_enough_stock_already_in_cart_message` filter-hook.
 * 
 * @param string     $message                Message.
 * @param WC_Product $product_data           Product data.
 * @param int        $stock_quantity         Quantity remaining.
 * @param int        $stock_quantity_in_cart 
 *
 * @return string
 */
function wp_kama_woocommerce_cart_product_not_enough_stock_already_in_message_filter( $message, $product_data, $stock_quantity, $stock_quantity_in_cart ){

	// filter...
	return $message;
}
$message(строка)
Message.
$product_data(WC_Product)
Product data.
$stock_quantity(int)
Quantity remaining.
$stock_quantity_in_cart(int)
-

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

С версии 5.3.0 Введена.

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

WC_Cart::add_to_cart()
woocommerce_cart_product_not_enough_stock_already_in_cart_message
woocommerce/includes/class-wc-cart.php 1242
$message = apply_filters( 'woocommerce_cart_product_not_enough_stock_already_in_cart_message', $message, $product_data, $stock_quantity, $stock_quantity_in_cart );

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

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