woocommerce_cart_item_data_to_validate filter-hookWC 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.

Usage

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
-

Where the hook is called

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

Where the hook is used in WooCommerce

Usage not found.