woocommerce_order_item_legacy_tax_conversion filter-hookWC 10.5.0

Filter the converted legacy tax value.

Allows plugins to customize how legacy scalar tax values are converted to the expected array format.

Usage

add_filter( 'woocommerce_order_item_legacy_tax_conversion', 'wp_kama_woocommerce_order_item_legacy_tax_conversion_filter', 10, 3 );

/**
 * Function for `woocommerce_order_item_legacy_tax_conversion` filter-hook.
 * 
 * @param array         $converted The converted tax data array.
 * @param float|string  $value     The original legacy scalar value.
 * @param WC_Order_Item $item      The order item being processed.
 *
 * @return array
 */
function wp_kama_woocommerce_order_item_legacy_tax_conversion_filter( $converted, $value, $item ){

	// filter...
	return $converted;
}
$converted(array)
The converted tax data array.
$value(float|string)
The original legacy scalar value.
$item(WC_Order_Item)
The order item being processed.

Changelog

Since 10.5.0 Introduced.

Where the hook is called

WC_Order_Item::convert_legacy_tax_value_to_array()
woocommerce_order_item_legacy_tax_conversion
woocommerce/includes/class-wc-order-item.php 708
return apply_filters( 'woocommerce_order_item_legacy_tax_conversion', $converted, $value, $this );

Where the hook is used in WooCommerce

Usage not found.