• I would like to have a field called ‘COD_total’. This field should replicate the value of the order_total when payment method is cash on delivery. If any other payment method is selected this field should have a value of 0. Then I would like to export the field as in Excel format like i do with any other fields. How may I go on achieving it with this plugin.

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

    (@algolplus)

    please follow to https://docs.algolplus.com/algol_order_export/fields/
    add key COD_total
    add code
    add_filter('woe_get_order_value_COD_total',function ($value, $order,$fieldname) {
    if( $order->get_payment_method() == "cod")
    $value = $order->get_total();
    return $value;
    },10,3);

    Thread Starter fahim1040

    (@fahim1040)

    It works almost perfectly. Can you modify to code to ensure the output of COD_total is “0” when payment method is not cash on delivery. Currently the output is empty

    Plugin Author algol.plus

    (@algolplus)

    just use
    if( $order->get_payment_method() == "cod")
    $value = $order->get_total();
    else
    $value = 0;

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