• Resolved ricardhh10

    (@ricardhh10)


    Good afternoon, first of all thank you for the usefulness of this plugin which is very useful.

    I have a doubt that I would like to solve:

    I have added some billing fields which are related to order refunds, which are as follows:

    order_total_fax_refunded
    order_total_tax_minus_refund
    order_refund
    order_total_inc_refund

    I would like to know if there is a hook or an option to add the condition that these fields only have a value when there has been a refund in the order, otherwise they are empty.

    Thank you. ??

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

    (@algolplus)

    hello

    pllease, add this code to section “Misc Settings”

    add_filter( "woe_fetch_order", function($row, $order){
    if( !$order->get_refunds() ) {
    $row['order_total_fax_refunded'] = 0;
    $row['order_total_tax_minus_refund'] = 0;
    $row['order_refund'] = 0;
    $row['order_total_inc_refund'] = 0;
    }
    return $row;
    },10,2);

    Thread Starter ricardhh10

    (@ricardhh10)

    The code worked perfectly, thank you very much as always. ??

    Problem solved.

    Plugin Author algol.plus

    (@algolplus)

    You’re very welcome

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.