woocommerce_remove_cart_item_from_session хук-событиеWC 3.6.0

Fires when cart item is removed from the session.

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

add_action( 'woocommerce_remove_cart_item_from_session', 'wp_kama_woocommerce_remove_cart_item_from_session_action', 10, 3 );

/**
 * Function for `woocommerce_remove_cart_item_from_session` action-hook.
 * 
 * @param string     $key     Cart item key.
 * @param array      $values  Cart item values e.g. quantity and product_id.
 * @param WC_Product $product The product being added to the cart.
 *
 * @return void
 */
function wp_kama_woocommerce_remove_cart_item_from_session_action( $key, $values, $product ){

	// action...
}
$key(строка)
Cart item key.
$values(массив)
Cart item values e.g. quantity and product_id.
$product(WC_Product)
The product being added to the cart.

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

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

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

WC_Cart_Session::get_cart_from_session()
woocommerce_remove_cart_item_from_session
woocommerce/includes/class-wc-cart-session.php 163
do_action( 'woocommerce_remove_cart_item_from_session', $key, $values, $product );
woocommerce/includes/class-wc-cart-session.php 188
do_action( 'woocommerce_remove_cart_item_from_session', $key, $values );
woocommerce/includes/class-wc-cart-session.php 196
do_action( 'woocommerce_remove_cart_item_from_session', $key, $values );

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

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