WC_Cart_Session::persistent_cart_updatepublicWC 1.0

Save the persistent cart when the cart is updated.

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

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

Возвращает

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

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

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

Код WC_Cart_Session::persistent_cart_update() WC 10.7.0

public function persistent_cart_update() {
	/**
	 * Filters whether the persistent cart is enabled.
	 *
	 * @since 3.4.0
	 * @param bool $enabled Whether the persistent cart is enabled. Default true.
	 */
	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(),
			)
		);
	}
}