• Resolved Mark J

    (@rajika4ever)


    Hi There

    thank you very much for such a great plugin.

    i want to add a custom column. i have two payment methods one is COD and another one is online payments. the column name will be “Payable Value” if someone select COD the column value will be order total but if someone already paid online the column value should be 0

    can you tell me how to do this?

    Thank you

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

    (@algolplus)

    hi

    Could you try this code?

    //how to calc
    add_filter('woe_get_order_value_cod_amount', function ($value,$order,$field) {
    	return ($order->payment_method=="cod")  ? ($order->total - $order->total_refunded)  : 0;
    },10, 3);
    // new column "Cod Amount" to UI
    add_filter('woe_get_order_fields', function ($fields) {
    	//add to field list
    	$fields['cod_amount'] = array( 'label' => 'COD Amount', 'colname' => 'COD Amount', 'checked' => 1 );
    	return $fields;
    });
    Thread Starter Mark J

    (@rajika4ever)

    wow.
    you are a genius. it works as exactly I wanted. thank you very very much!

    Plugin Author algol.plus

    (@algolplus)

    you’re welcome

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add new custom column’ is closed to new replies.