woocommerce_cart_product_cannot_be_purchased_message хук-фильтрWC 3.8.0

Filters message about product unable to be purchased.

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

add_filter( 'woocommerce_cart_product_cannot_be_purchased_message', 'wp_kama_woocommerce_cart_product_cannot_be_purchased_message_filter', 10, 2 );

/**
 * Function for `woocommerce_cart_product_cannot_be_purchased_message` filter-hook.
 * 
 * @param string     $message      Message.
 * @param WC_Product $product_data Product data.
 *
 * @return string
 */
function wp_kama_woocommerce_cart_product_cannot_be_purchased_message_filter( $message, $product_data ){

	// filter...
	return $message;
}
$message(строка)
Message.
$product_data(WC_Product)
Product data.

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

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

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

WC_Cart::add_to_cart()
woocommerce_cart_product_cannot_be_purchased_message
woocommerce/includes/class-wc-cart.php 1177
$message = apply_filters( 'woocommerce_cart_product_cannot_be_purchased_message', $message, $product_data );

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

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