woocommerce_pre_remove_cart_item_from_session filter-hook . WC 3.6.0
Allow 3rd parties to validate this item before it's added to cart and add their own notices.
Usage
add_filter( 'woocommerce_pre_remove_cart_item_from_session', 'filter_function_name_2882', 10, 3 ); function filter_function_name_2882( $remove_cart_item_from_session, $key, $values ){ // filter... return $remove_cart_item_from_session; }
- $remove_cart_item_from_session(true|false)
- If true, the item will not be added to the cart.
Default: false - $key(string)
- Cart item key.
- $values(array)
- Cart item values e.g. quantity and product_id.
Changelog
Since 3.6.0 | Introduced. |
Where the hook is called
woocommerce_pre_remove_cart_item_from_session
woocommerce/includes/class-wc-cart-session.php 127
if ( apply_filters( 'woocommerce_pre_remove_cart_item_from_session', false, $key, $values ) ) {