WC_Cart_Session::set_session()publicWC 1.0

Sets the php session data for the cart and coupons.

Метод класса: WC_Cart_Session{}

Хуки из метода

Возвращает

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

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

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

Код WC_Cart_Session::set_session() WC 8.7.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' );
}