Automattic\WooCommerce\StoreApi\Routes\V1

AbstractCartRoute::load_cart_session()protectedWC 1.0

Load the cart session before handling responses.

Method of the class: AbstractCartRoute{}

No Hooks.

Return

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->load_cart_session( $request );
$request(\WP_REST_Request) (required)
Request object.

AbstractCartRoute::load_cart_session() code WC 9.3.3

protected function load_cart_session( \WP_REST_Request $request ) {
	if ( $this->has_cart_token( $request ) ) {
		// Overrides the core session class.
		add_filter(
			'woocommerce_session_handler',
			function () {
				return SessionHandler::class;
			}
		);
	}
	$this->cart_controller->load_cart();
}