wc_empty_cart()
Clears the cart session when called.
Хуков нет.
Возвращает
null. Ничего (null).
Использование
wc_empty_cart();
Код wc_empty_cart() wc empty cart WC 11.2.2
function wc_empty_cart() {
if ( ! isset( WC()->cart ) || '' === WC()->cart ) {
WC()->cart = new WC_Cart();
}
WC()->cart->empty_cart( false );
}