WordPress at Your Fingertips
function is not described

WC_Gateway_COD::get_canonical_order_shipping_item_rate_ids() private WC 3.4.0

Converts the chosen rate IDs generated by Shipping Methods to a canonical 'method_id:instance_id' format.

{} It's a method of the class: WC_Gateway_COD{}

No Hooks.


Array. $canonical_rate_ids Rate IDs in a canonical format.


// private - for code of main (parent) class only
$result = $this->get_canonical_order_shipping_item_rate_ids( $order_shipping_items );
$order_shipping_items(array) (required)
Array of WC_Order_Item_Shipping objects.


Since 3.4.0 Introduced.

Code of WC_Gateway_COD::get_canonical_order_shipping_item_rate_ids() WC 5.7.1

private function get_canonical_order_shipping_item_rate_ids( $order_shipping_items ) {

	$canonical_rate_ids = array();

	foreach ( $order_shipping_items as $order_shipping_item ) {
		$canonical_rate_ids[] = $order_shipping_item->get_method_id() . ':' . $order_shipping_item->get_instance_id();

	return $canonical_rate_ids;