woocommerce_before_cart_emptied хук-событиеWC 9.7.0

Fires before the cart is emptied.

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

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 Whether the persistent cart will be cleared too.
 *
 * @return void
 */
function wp_kama_woocommerce_before_cart_emptied_action( $clear_persistent_cart ){

	// action...
}
$clear_persistent_cart(true|false)
Whether the persistent cart will be cleared too.

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

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

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

WC_Cart::empty_cart()
woocommerce_before_cart_emptied
woocommerce/includes/class-wc-cart.php 666
do_action( 'woocommerce_before_cart_emptied', $clear_persistent_cart );

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

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