WC_Cart::get_chosen_shipping_methodsprotectedWC 3.2.0

Given a set of packages with rates, get the chosen ones only.

Method of the class: WC_Cart{}

No Hooks.

Returns

Array.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_chosen_shipping_methods( $calculated_shipping_packages );
$calculated_shipping_packages(array)
Array of packages.
Default: array()

Changelog

Since 3.2.0 Introduced.

WC_Cart::get_chosen_shipping_methods() code WC 9.9.4

protected function get_chosen_shipping_methods( $calculated_shipping_packages = array() ) {
	return ShippingUtil::get_selected_shipping_rates_from_packages( $calculated_shipping_packages );
}