wc_empty_cart()WC 1.0

Clears the cart session when called.

Хуков нет.

Возвращает

null. Ничего (null).

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

wc_empty_cart();

Код wc_empty_cart() WC 8.7.0

function wc_empty_cart() {
	if ( ! isset( WC()->cart ) || '' === WC()->cart ) {
		WC()->cart = new WC_Cart();
	}
	WC()->cart->empty_cart( false );
}