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

Allow 3rd parties to validate this item before it's added to cart and add their own notices.

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

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

/**
 * Function for `woocommerce_remove_cart_item_from_session` action-hook.
 * 
 * @param bool   $remove_cart_item_from_session If true, the item will not be added to the cart.
 * @param string $key                           Cart item key.
 *
 * @return void
 */
function wp_kama_woocommerce_remove_cart_item_from_session_action( $remove_cart_item_from_session, $key ){

	// action...
}
$remove_cart_item_from_session(true|false)
If true, the item will not be added to the cart.
По умолчанию: false
$key(строка)
Cart item key.

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

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

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

WC_Cart_Session::get_cart_from_session()
woocommerce_remove_cart_item_from_session
woocommerce/includes/class-wc-cart-session.php 142
do_action( 'woocommerce_remove_cart_item_from_session', $key, $values );
woocommerce/includes/class-wc-cart-session.php 157
do_action( 'woocommerce_remove_cart_item_from_session', $key, $values );
woocommerce/includes/class-wc-cart-session.php 165
do_action( 'woocommerce_remove_cart_item_from_session', $key, $values );

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

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