wc_empty_cart()
Clears the cart session when called.
No Hooks.
Return
null
. Nothing.
Usage
wc_empty_cart();
wc_empty_cart() wc empty cart code WC 7.7.0
function wc_empty_cart() { if ( ! isset( WC()->cart ) || '' === WC()->cart ) { WC()->cart = new WC_Cart(); } WC()->cart->empty_cart( false ); }