woocommerce_order_item_legacy_tax_conversion хук-фильтрWC 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.

Использование

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(массив)
The converted tax data array.
$value(float|строка)
The original legacy scalar value.
$item(WC_Order_Item)
The order item being processed.

Список изменений

С версии 10.5.0 Введена.

Где вызывается хук

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

Где используется хук в WooCommerce

Использование не найдено.