Support » Plugin: Advanced Order Export For WooCommerce » Add calculated field

  • Resolved rszegheo

    (@rszegheo)


    Hi,
    can you advise me how to add a calculated field to a report whose value will be calculated as follows:
    new field = [Order Subtotal – Cart Discount] – [_stripe_fee]
    ?

    Best regards

    Robert

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author algol.plus

    (@algolplus)

    hi Robert

    please, follow to https://docs.algolplus.com/algol_order_export/fields/
    add key newfield1
    use this code

    add_filter('woe_get_order_value_newfield1',function ($value, $order,$fieldname) {
    return $order->get_subtotal() - $order->get_total_discount() - (float)$order->get_meta("_stripe_fee");
    },10,3);
    Thread Starter rszegheo

    (@rszegheo)

    GREAT! it works!
    thank you very much

    Plugin Author algol.plus

    (@algolplus)

    you’re very welcome

    Thread Starter rszegheo

    (@rszegheo)

    Hi,
    how can I create a calculated field First Name (Shipping) & space & Last Name (Shipping)? I tried Custom PHP code to modify the output, but I couldn’t.

    Sincerely

    Robo

    Plugin Author algol.plus

    (@algolplus)

    hi Robo

    Why do you need it ?

    please, open >Setup Fields>Shipping Address and drag field “Full Name (Shipping)” to export.

    thanks, Alex

    • This reply was modified 8 months, 2 weeks ago by algol.plus.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Add calculated field’ is closed to new replies.