Automattic\WooCommerce\StoreApi\Utilities

CartController::get_cart_for_response()publicWC 1.0

Gets the latest cart instance, and ensures totals have been calculated before returning.

Method of the class: CartController{}

No Hooks.

Return

\WC_Cart.

Usage

$CartController = new CartController();
$CartController->get_cart_for_response();

CartController::get_cart_for_response() code WC 9.3.1

public function get_cart_for_response() {
	return did_action( 'woocommerce_after_calculate_totals' ) ? $this->get_cart_instance() : $this->calculate_totals();
}