WC_Cart_Totals::combine_item_taxes( array $item_taxes )

Combine item taxes into a single array, preserving keys.


Description Description


Parameters Parameters

$item_taxes

(Required) Taxes to combine.


Top ↑

Return Return

(array)


Top ↑

Source Source

File: includes/class-wc-cart-totals.php

	protected function combine_item_taxes( $item_taxes ) {
		$merged_taxes = array();
		foreach ( $item_taxes as $taxes ) {
			foreach ( $taxes as $tax_id => $tax_amount ) {
				if ( ! isset( $merged_taxes[ $tax_id ] ) ) {
					$merged_taxes[ $tax_id ] = 0;
				}
				$merged_taxes[ $tax_id ] += $tax_amount;
			}
		}
		return $merged_taxes;
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.2.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

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