Title: Export field based on Payment method
Last modified: April 25, 2020

---

# Export field based on Payment method

 *  Resolved [spletnasinergija](https://wordpress.org/support/users/spletnasinergija/)
 * (@spletnasinergija)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/export-field-based-on-payment-method/)
 * Hello,
 * Is it possible to export field “Order Total Amount” based on Payment Method?
 * I have a few fields Name, Address, Shipping City, … , and last one is Order Total
   Amount.
 * When i preview output for export it shows everything correct except “Order Total
   Amount”. This field should be visible only at Payment method COD (Cash On Delivery).
 * How could this be achieved?
 * Thanks,
    – Thomas

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

 *  Plugin Author [algol.plus](https://wordpress.org/support/users/algolplus/)
 * (@algolplus)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/export-field-based-on-payment-method/#post-12729643)
 * Hello Thomas
 * please, follow to [https://algolplus.freshdesk.com/support/solutions/articles/25000016635-add-calculated-field-for-order-](https://algolplus.freshdesk.com/support/solutions/articles/25000016635-add-calculated-field-for-order-)
   
   use meta key “cod_amount” and this PHP code. thanks, Alex ​
 *     ```
       add_filter('woe_get_order_value_cod_amount',function ($value,$order,$fieldname) {
       if( $order->get_payment_method() == "cod")
         $value = $order->get_total();
       else
         $value = 0;
       return $value;
       },10,3);
       ```
   
 *  Thread Starter [spletnasinergija](https://wordpress.org/support/users/spletnasinergija/)
 * (@spletnasinergija)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/export-field-based-on-payment-method/#post-12742699)
 * Hello Alex,
 * Thank you very much. That works perfectly.
 * Best Regards,
    – Thomas
 *  Plugin Author [algol.plus](https://wordpress.org/support/users/algolplus/)
 * (@algolplus)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/export-field-based-on-payment-method/#post-12743442)
 * you’re welcome

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

The topic ‘Export field based on Payment method’ is closed to new replies.

 * ![](https://ps.w.org/woo-order-export-lite/assets/icon-256x256.png?rev=1365554)
 * [Advanced Order Export For WooCommerce](https://wordpress.org/plugins/woo-order-export-lite/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woo-order-export-lite/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woo-order-export-lite/)
 * [Active Topics](https://wordpress.org/support/plugin/woo-order-export-lite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woo-order-export-lite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woo-order-export-lite/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [algol.plus](https://wordpress.org/support/users/algolplus/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/export-field-based-on-payment-method/#post-12743442)
 * Status: resolved