woocommerce_before_cart_emptied
Empties the cart and optionally the persistent cart too.
Usage
add_action( 'woocommerce_before_cart_emptied', 'wp_kama_woocommerce_before_cart_emptied_action' ); /** * Function for `woocommerce_before_cart_emptied` action-hook. * * @param bool $clear_persistent_cart Should the persistent cart be cleared too. * * @return void */ function wp_kama_woocommerce_before_cart_emptied_action( $clear_persistent_cart ){ // action... }
- $clear_persistent_cart(true|false)
- Should the persistent cart be cleared too.
Default: true
Where the hook is called
woocommerce_before_cart_emptied
woocommerce/includes/class-wc-cart.php 637
do_action( 'woocommerce_before_cart_emptied', $clear_persistent_cart );