Title: Modify Fields
Last modified: November 8, 2018

---

# Modify Fields

 *  Resolved [Soptep](https://wordpress.org/support/users/soptep/)
 * (@soptep)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/modify-fields/)
 * Hello Alex, thanks for the great plugin.
 * I would like to ask two things if you could help me:
    1) I have a plugin that
   calculates the order’s total weight. Your plugin can read and display correctly
   the value. The field has the name: “plain_orders_order_weight”. My problem is
   that the weight is in grams and I would like to export it as Kg, so I would like
   to return this value after dividing it by 1000. How can I implement this?
 * 2) I would like the field order total amount (order_total) to be displayed as
   is if the payment method is Cash on Delivery (cod) or zero otherwise.
 * Best Regards!

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

 *  Plugin Author [algol.plus](https://wordpress.org/support/users/algolplus/)
 * (@algolplus)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/modify-fields/#post-10862395)
 * Hello
 * 1. Hook name is “woe_get_order_value_{fieldname}”. So code should be
 *     ```
       add_filter('woe_get_order_value_order_weight', function ($value, $order, $fieldname) {
       	return round($value/1000,3); // not sure if you need round()
       },10,3);
       ```
   
 * 2. You can add something like this to section “Misc Settings” too
 *     ```
       add_filter('woe_get_order_value_order_total', function ($value, $order, $fieldname) {
       	if(  $order->get_payment_method() != "cod")
       		$value = 0;
       	return $value;
       },10,3);
       ```
   
 *  Thread Starter [Soptep](https://wordpress.org/support/users/soptep/)
 * (@soptep)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/modify-fields/#post-10865073)
 * Great Alex, it works as expected! I was a little bit confused about the hook 
   names, but now you clarified it.
 * Thanks a lot!
 *  Plugin Author [algol.plus](https://wordpress.org/support/users/algolplus/)
 * (@algolplus)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/modify-fields/#post-10865884)
 * you’re welcome.
 * you can hover label in “Setup fields” to see internal field name.
    see [https://imgur.com/a/Ij9pV7J](https://imgur.com/a/Ij9pV7J)
 * have a good weekend.

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

The topic ‘Modify Fields’ 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: [7 years, 6 months ago](https://wordpress.org/support/topic/modify-fields/#post-10865884)
 * Status: resolved