woocommerce_cart_item_product_id
Использование
add_filter( 'woocommerce_cart_item_product_id', 'wp_kama_woocommerce_cart_item_product_id_filter', 10, 3 ); /** * Function for `woocommerce_cart_item_product_id` filter-hook. * * @param $cart_item_product_id * @param $cart_item * @param $cart_item_key * * @return */ function wp_kama_woocommerce_cart_item_product_id_filter( $cart_item_product_id, $cart_item, $cart_item_key ){ // filter... return $cart_item_product_id; }
- $cart_item_product_id
- -
- $cart_item
- -
- $cart_item_key
- -
Где вызывается хук
В файле: /templates/cart/cart.php
woocommerce_cart_item_product_id
woocommerce/templates/cart/cart.php 42
$product_id = apply_filters( 'woocommerce_cart_item_product_id', $cart_item['product_id'], $cart_item, $cart_item_key );
woocommerce/templates/cart/mini-cart.php 32
$product_id = apply_filters( 'woocommerce_cart_item_product_id', $cart_item['product_id'], $cart_item, $cart_item_key );