woocommerce_cart_product_cannot_add_another_message filter-hookWC 4.5.0

Filters message about more than 1 product being added to cart.

Usage

add_filter( 'woocommerce_cart_product_cannot_add_another_message', 'wp_kama_woocommerce_cart_product_cannot_add_another_message_filter', 10, 2 );

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

	// filter...
	return $message;
}
$message(string)
Message.
$product_data(WC_Product)
Product data.

Changelog

Since 4.5.0 Introduced.

Where the hook is called

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

Where the hook is used in WooCommerce

Usage not found.