WordPress at Your Fingertips
function is not described

WC_Cart_Session::set_session() public WC 1.0

Sets the php session data for the cart and coupons.

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

Hooks from the method

Return

null. Nothing.

Usage

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

Code of WC_Cart_Session::set_session() WC 5.9.0

public function set_session() {
	WC()->session->set( 'cart', $this->get_cart_for_session() );
	WC()->session->set( 'cart_totals', $this->cart->get_totals() );
	WC()->session->set( 'applied_coupons', $this->cart->get_applied_coupons() );
	WC()->session->set( 'coupon_discount_totals', $this->cart->get_coupon_discount_totals() );
	WC()->session->set( 'coupon_discount_tax_totals', $this->cart->get_coupon_discount_tax_totals() );
	WC()->session->set( 'removed_cart_contents', $this->cart->get_removed_cart_contents() );

	do_action( 'woocommerce_cart_updated' );
}