WC_Cart_Session::persistent_cart_update()publicWC 1.0

Save the persistent cart when the cart is updated.

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->persistent_cart_update();

WC_Cart_Session::persistent_cart_update() code WC 8.6.1

public function persistent_cart_update() {
	if ( get_current_user_id() && apply_filters( 'woocommerce_persistent_cart_enabled', true ) ) {
		update_user_meta(
			get_current_user_id(),
			'_woocommerce_persistent_cart_' . get_current_blog_id(),
			array(
				'cart' => $this->get_cart_for_session(),
			)
		);
	}
}