[ad_1]
Replies: 2
Hi there, how can i calculate in “Custom PHP code to modify output” with “$item[‘tax_rate’]”?
i tried
add_filter('woe_get_order_product_value_PurchaseQuantTax', function ($value, $order, $item, $product,$item_meta) {
if( class_exists("Atum\Inc\Helpers") AND $product) {
$product = Atum\Inc\Helpers::get_atum_product( $product->get_id() );
$valueatum = $product->get_purchase_price();
}
$value = $valueatum*$item['qty']*$item['tax_rate'];
return $value;
}, 10, 5);(don´t bother with the logic of the mathematics, it´s just an example)
but $item[‘tax_rate’] always stays 0.
what irritates me, is that i can use “[P] Item tax rate” in the output from “Product order items” without problems, but can´t use it in the function.
