• Resolved holle75

    (@holle75)


    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.

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘$item[‘tax_rate’]’ is closed to new replies.