Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter msmeets

    (@msmeets)

    My mistake looks like the values are correct!

    I try to do the same with the shipping costs. The following filter returns a rounded value. Looks like get_shipping_total() ignores the parameters. Do you have any idea how to fix that?

    //export Shipping line as Products
    add_filter(‘woe_fetch_order_products’, function ($products,$order,$labels, $format, $static_vals) {
    $i = count ($products);
    foreach ( $order->get_items(‘shipping’) as $item_id=>$item ) {
    $row = array();
    $i++;
    $taxes = $item->get_total_tax();
    foreach ( $labels as $field => $label ) {
    if ( $field == ‘item_price’ ) {
    $row[‘item_price’] = $order->get_shipping_total( $item, false, false );
    }
    }
    $products[] = $row;
    }
    return $products;
    }, 10, 5);

    Matthijs

    Thread Starter msmeets

    (@msmeets)

    I see. The filter works. Unfortunately, these WordPress $order functions again return rounded values. Is this something I have to fix myself?

    Other question. Is there also a filter for the WC_Product class? I have tried the following but it doesn’t seem to go well:

    add_filter (“woe_fetch_product”, function ($row, $product) {}

    Thanks again for your time.

    Thread Starter msmeets

    (@msmeets)

    No problem, but what should I do to make the other fields not rounded in the export?

    If I’m not mistaken those fields are not in the postmeta like _order_tax.

    I hope you can help. This is essential for proper processing in the accounting system.

    Thread Starter msmeets

    (@msmeets)

    That indeed seems to work, but in my case it concerns the following fields:

    order_subtotal
    order_shipping
    order_total
    order_total_tax
    item_price

    Sorry for the confusion. I assumed there would be one adjustment for all fields.

    Thread Starter msmeets

    (@msmeets)

    Thank you for your message.

    Then I still get 0.82. While I expect 0.824862. Which Field format should I select? Does the tab where I add the field matter?

    Below some extra info:

    WooCommerce order values:
    Total: 9,165138
    Tax: 0.824862

    Values after export:
    Total: 9.17
    Tax: 0.82

    Settings:
    Prices entered including VAT: Yes
    Tax rate: 9%
    Price: € 9.99

    Matthijs

    Thread Starter msmeets

    (@msmeets)

    Hi Alex,

    This setting is not enabled.

    To rule things out I created a test environment with a clean installation of WordPress, Woocommerce and Advanced Order Export For WooCommerce. Unfortunately the same result.

    Matthijs

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