WC_Cart_Session::set_session()
Sets the php session data for the cart and coupons.
Method of the class: WC_Cart_Session{}
Hooks from the method
Return
null
. Nothing (null).
Usage
$WC_Cart_Session = new WC_Cart_Session(); $WC_Cart_Session->set_session();
WC_Cart_Session::set_session() WC Cart Session::set session code WC 9.2.3
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' ); }