<span class="resolved" aria-label="Resolved" title="Topic is resolved."></span>$item[‘tax_rate’]

[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.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer