WordPress at Your Fingertips
function is not described

WC_Cart::get_cart_item_tax_classes() public WC 1.0

Get all tax classes for items in the cart.

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

No Hooks.

Return

Array.

Usage

$WC_Cart = new WC_Cart();
$WC_Cart->get_cart_item_tax_classes();

Code of WC_Cart::get_cart_item_tax_classes() WC 5.7.0

public function get_cart_item_tax_classes() {
	$found_tax_classes = array();

	foreach ( WC()->cart->get_cart() as $item ) {
		if ( $item['data'] && ( $item['data']->is_taxable() || $item['data']->is_shipping_taxable() ) ) {
			$found_tax_classes[] = $item['data']->get_tax_class();
		}
	}

	return array_unique( $found_tax_classes );
}