woocommerce_add_to_cart_sold_individually_found_in_cart
Использование
add_filter( 'woocommerce_add_to_cart_sold_individually_found_in_cart', 'wp_kama_woocommerce_add_to_cart_sold_individually_found_in_filter', 10, 5 ); /** * Function for `woocommerce_add_to_cart_sold_individually_found_in_cart` filter-hook. * * @param $condition * @param $product_id * @param $variation_id * @param $cart_item_data * @param $cart_id * * @return */ function wp_kama_woocommerce_add_to_cart_sold_individually_found_in_filter( $condition, $product_id, $variation_id, $cart_item_data, $cart_id ){ // filter... return $condition; }
- $condition
- -
- $product_id
- -
- $variation_id
- -
- $cart_item_data
- -
- $cart_id
- -
Где вызывается хук
woocommerce_add_to_cart_sold_individually_found_in_cart
woocommerce/includes/class-wc-cart.php 1157
$found_in_cart = apply_filters( 'woocommerce_add_to_cart_sold_individually_found_in_cart', $cart_item_key && $this->cart_contents[ $cart_item_key ]['quantity'] > 0, $product_id, $variation_id, $cart_item_data, $cart_id );