Title: Basic Calculations from custom fields
Last modified: February 23, 2023

---

# Basic Calculations from custom fields

 *  [mitsi380](https://wordpress.org/support/users/mitsi380/)
 * (@mitsi380)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/basic-calculations-from-custom-fields/)
 * I need to manipulate dimensions for manufacturing reports, eg; width – 40 i have
   tried your examples with no luck. Would you be able to help me with an example
   of the above?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fbasic-calculations-from-custom-fields%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [algol.plus](https://wordpress.org/support/users/algolplus/)
 * (@algolplus)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/basic-calculations-from-custom-fields/#post-16499469)
 * hi
 * please, use this code in “MIsc Settings”
   `add_filter('woe_get_order_product_value_width',
   function ($value, $order, $item, $product,$item_meta) {return (float)$value -
   40;}, 10, 5);
 * more details [https://docs.algolplus.com/algol_order_export/hooks-filters/](https://docs.algolplus.com/algol_order_export/hooks-filters/)
 *  Thread Starter [mitsi380](https://wordpress.org/support/users/mitsi380/)
 * (@mitsi380)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/basic-calculations-from-custom-fields/#post-16500878)
 * Hi thank you for the quick response. It working better that it did, however i
   would like slat_width to equal the: width – 40
 *     ```wp-block-code
       add_filter('woe_get_order_product_value_slat_width', function ($value, $order, $item, $product,$item_meta) {
       return (float)$value - 40;
       }, 10, 5);
       ```
   
 * ![](https://flic.kr/p/2oixQyA)
 *  Plugin Author [algol.plus](https://wordpress.org/support/users/algolplus/)
 * (@algolplus)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/basic-calculations-from-custom-fields/#post-16501369)
 * Please, try
 * return (float)$product->get_width() – 40;
 *  Thread Starter [mitsi380](https://wordpress.org/support/users/mitsi380/)
 * (@mitsi380)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/basic-calculations-from-custom-fields/#post-16507976)
 * Thank you, although i get an error.
 * The code you are trying to save produced a fatal error on line 2:**syntax error,
   unexpected ‘–’ (T_STRING), expecting ‘;’**
 * add_filter(‘woe_get_order_product_value_slat_width’, function ($value, $order,
   $item, $product,$item_meta) {
   return (float)$product->get_width() – 40;}, 10,
   5);
 *  Plugin Author [algol.plus](https://wordpress.org/support/users/algolplus/)
 * (@algolplus)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/basic-calculations-from-custom-fields/#post-16508226)
 * `forum replaced - with –`
   Use
 * `return (float)$product->get_width() - 40;`

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

The topic ‘Basic Calculations from custom 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/)

 * 5 replies
 * 2 participants
 * Last reply from: [algol.plus](https://wordpress.org/support/users/algolplus/)
 * Last activity: [3 years, 3 months ago](https://wordpress.org/support/topic/basic-calculations-from-custom-fields/#post-16508226)
 * Status: not resolved