WordPress at Your Fingertips
function is not described

WC_Cart_Session::destroy_cart_session() public WC 3.2.0

Destroy cart session data.

{} It's a method of the class: WC_Cart_Session{}

No Hooks.

Return

null. Nothing.

Usage

$WC_Cart_Session = new WC_Cart_Session();
$WC_Cart_Session->destroy_cart_session();

Changelog

Since 3.2.0 Introduced.

Code of WC_Cart_Session::destroy_cart_session() WC 5.9.0

public function destroy_cart_session() {
	WC()->session->set( 'cart', null );
	WC()->session->set( 'cart_totals', null );
	WC()->session->set( 'applied_coupons', null );
	WC()->session->set( 'coupon_discount_totals', null );
	WC()->session->set( 'coupon_discount_tax_totals', null );
	WC()->session->set( 'removed_cart_contents', null );
	WC()->session->set( 'order_awaiting_payment', null );
}