woocommerce_cart_item_data_to_validate хук-фильтрWC 1.0

Gets a hash of important product data that when changed should cause cart items to be invalidated.

The woocommerce_cart_item_data_to_validate filter can be used to add custom properties.

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

add_filter( 'woocommerce_cart_item_data_to_validate', 'wp_kama_woocommerce_cart_item_data_to_validate_filter' );

/**
 * Function for `woocommerce_cart_item_data_to_validate` filter-hook.
 * 
 * @param  $product 
 *
 * @return 
 */
function wp_kama_woocommerce_cart_item_data_to_validate_filter( $product ){

	// filter...
	return $product;
}
$product
-

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

wc_get_cart_item_data_hash()
woocommerce_cart_item_data_to_validate
woocommerce/includes/wc-cart-functions.php 561-568
apply_filters(
	'woocommerce_cart_item_data_to_validate',
	array(
		'type'       => $product->get_type(),
		'attributes' => 'variation' === $product->get_type() ? $product->get_variation_attributes() : '',
	),
	$product
)

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

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