wc_get_chosen_shipping_method_ids()

Gets chosen shipping method IDs from chosen_shipping_methods session, without instance IDs.


Description Description


Return Return

(string[])


Top ↑

Source Source

File: includes/wc-cart-functions.php

function wc_get_chosen_shipping_method_ids() {
	$method_ids     = array();
	$chosen_methods = WC()->session->get( 'chosen_shipping_methods', array() );
	foreach ( $chosen_methods as $chosen_method ) {
		$chosen_method = explode( ':', $chosen_method );
		$method_ids[]  = current( $chosen_method );
	}
	return $method_ids;
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.6.2 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.