woocommerce_product_add_to_cart_success_message хук-фильтрWC 9.2.0

Filter product add to cart success message.

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

add_filter( 'woocommerce_product_add_to_cart_success_message', 'wp_kama_woocommerce_product_add_to_cart_success_message_filter', 10, 2 );

/**
 * Function for `woocommerce_product_add_to_cart_success_message` filter-hook.
 * 
 * @param string            $text The success message when a product is added to the cart.
 * @param WC_Product_Simple $that Reference to the current WC_Product_Simple instance.
 *
 * @return string
 */
function wp_kama_woocommerce_product_add_to_cart_success_message_filter( $text, $that ){

	// filter...
	return $text;
}
$text(строка)
The success message when a product is added to the cart.
$that(WC_Product_Simple)
Reference to the current WC_Product_Simple instance.

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

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

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

WC_Product_Simple::add_to_cart_success_message()
woocommerce_product_add_to_cart_success_message
woocommerce/includes/class-wc-product-simple.php 99
return apply_filters( 'woocommerce_product_add_to_cart_success_message', $text, $this );

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

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