woocommerce_pre_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_filter( 'woocommerce_pre_remove_cart_item_from_session', 'filter_function_name_5008', 10, 3 ); function filter_function_name_5008( $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.
По умолчанию: false - $key(строка)
- Cart item key.
- $values(массив)
- Cart item values e.g. quantity and product_id.
Список изменений
С версии 3.6.0 | Введена. |
Где вызывается хук
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 ) ) {