Title: Error when export order
Last modified: September 28, 2022

---

# Error when export order

 *  [anhduc.bkhn](https://wordpress.org/support/users/anhducbkhn/)
 * (@anhducbkhn)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/error-when-export-order/)
 * Hi there,
 * This is my evn:
 *     ```
       WC: 6.8
       WP: 6.0.2
       PHP: 8.1.8
       Plugins:
       - Advanced Order Export For WooCommerce: 3.3.2
       ```
   
 * When I run an export, I got the error message:
 *     ```
       2022-09-28T08:16:20+00:00 CRITICAL Uncaught TypeError: Unsupported operand types: string - int in /usr/share/nginx/html/wp-content/plugins/woo-order-export-lite/classes/core/class-wc-order-export-order-fields.php:270
       Stack trace:
       #0 /usr/share/nginx/html/wp-content/plugins/woo-order-export-lite/classes/core/class-wc-order-export-data-extractor.php(1743): WC_Order_Export_Order_Fields->get()
       #1 /usr/share/nginx/html/wp-content/plugins/woo-order-export-lite/classes/core/class-wc-order-export-engine.php(513): WC_Order_Export_Data_Extractor::fetch_order_data()
       #2 /usr/share/nginx/html/wp-content/plugins/woo-order-export-lite/classes/admin/tabs/ajax/trait-wc-order-export-admin-tab-abstract-ajax-export.php(86): WC_Order_Export_Engine::build_file()
       #3 /usr/share/nginx/html/wp-content/plugins/woo-order-export-lite/classes/class-wc-order-export-admin.php(511): WC_Order_Export_Admin_Tab_Abstract->ajax_export_part()
       #4 /usr/share/nginx/html/wp-includes/class-wp-hook.php(307): WC_Order_Export_Admin->ajax_gate()
       #5 /usr/share/nginx/html/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
       #6 /usr/share/nginx/html/wp-includes/plugin.php(476): WP_Hook->do_action()
       #7 /usr/share/nginx/html/wp-admin/admin-ajax.php(187): do_action()
       #8 {main}
         thrown in /usr/share/nginx/html/wp-content/plugins/woo-order-export-lite/classes/core/class-wc-order-export-order-fields.php on line 270
       ```
   
 * I fixed it by myself
 *     ```
       wp-content/plugins/woo-order-export-lite/classes/core/class-wc-order-export-order-fields.php
   
       line 270: $row[$field] = ( method_exists($this->order,"get_shipping_total") ? $this->order->get_shipping_total() : $this->order->get_total_shipping() ) - $this->order->get_total_shipping_refunded();
   
       This is what I fixed:
   
       $row[$field] = (int)( method_exists($this->order,"get_shipping_total") ? $this->order->get_shipping_total() : $this->order->get_total_shipping() ) - $this->order->get_total_shipping_refunded();
       ```
   
 * Please address on this issue.

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

 *  Plugin Author [algol.plus](https://wordpress.org/support/users/algolplus/)
 * (@algolplus)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/error-when-export-order/#post-16050628)
 * hi
 * Does this order have no shipping at all ?
 * (int) will reject digits after the decimal point.
    So (float) will be better 
   solution.
 *  Plugin Author [algol.plus](https://wordpress.org/support/users/algolplus/)
 * (@algolplus)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/error-when-export-order/#post-16050663)
 * We’ll include this change in next version
 *     ```
       $row[$field] = floatval( method_exists($this->order,"get_shipping_total") ?$this->order->get_shipping_total() : $this->order->get_total_shipping() ) - $this->order->get_total_shipping_refunded();
       ```
   
    -  This reply was modified 3 years, 8 months ago by [algol.plus](https://wordpress.org/support/users/algolplus/).
 *  Thread Starter [anhduc.bkhn](https://wordpress.org/support/users/anhducbkhn/)
 * (@anhducbkhn)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/error-when-export-order/#post-16053510)
 * [@algolplus](https://wordpress.org/support/users/algolplus/) I just check the
   order
 * – It was created manually
    – No shipping at all
 *  Plugin Author [algol.plus](https://wordpress.org/support/users/algolplus/)
 * (@algolplus)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/error-when-export-order/#post-16053520)
 * Thank you for detailed explanation.
    please, use my version of code
 *  Thread Starter [anhduc.bkhn](https://wordpress.org/support/users/anhducbkhn/)
 * (@anhducbkhn)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/error-when-export-order/#post-16053696)
 * [@algolplus](https://wordpress.org/support/users/algolplus/) ok, I fixed it at
   my side.
    wait for next release.
 *  Plugin Author [algol.plus](https://wordpress.org/support/users/algolplus/)
 * (@algolplus)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/error-when-export-order/#post-16054608)
 * ok, we’ll notify you
 *  [ryanljf](https://wordpress.org/support/users/ryanljf/)
 * (@ryanljf)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/error-when-export-order/#post-16226053)
 * Hi,
 * Can anyone advice how to fix this? Received error message while Export Orders
   in progress. Error message as per below :
 *     ```
       <html>
       <head><title>504 Gateway Time-out</title></head>
       <body>
       <center><h1>504 Gateway Time-out</h1></center>
       <hr><center>nginx</center>
       </body>
       </html>
       ```
   
 *  Plugin Author [algol.plus](https://wordpress.org/support/users/algolplus/)
 * (@algolplus)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/error-when-export-order/#post-16226115)
 * Hello
 * How many estimated orders you see in Preview ?
    Can you switch to CSV format –
   will you get same error ?
 * thanks, Alex
    -  This reply was modified 3 years, 6 months ago by [algol.plus](https://wordpress.org/support/users/algolplus/).
 *  [ryanljf](https://wordpress.org/support/users/ryanljf/)
 * (@ryanljf)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/error-when-export-order/#post-16226189)
 * Hi,
 * It was set as CVS by default
 *  Plugin Author [algol.plus](https://wordpress.org/support/users/algolplus/)
 * (@algolplus)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/error-when-export-order/#post-16226330)
 * Please, set Date Range filter to one date. Will you get results ?
 * How many estimated orders you see if you press Preview ? 10,000 ? 1,000 ?
 *  [ryanljf](https://wordpress.org/support/users/ryanljf/)
 * (@ryanljf)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/error-when-export-order/#post-16229335)
 * Hi,
 * Orders is about 1,000 ++. Same error message appeared
 *  Plugin Author [algol.plus](https://wordpress.org/support/users/algolplus/)
 * (@algolplus)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/error-when-export-order/#post-16229611)
 * If you have staging website – please, disable all plugins except WooCommerce 
   and Export.
    Will you still see the error ?

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

The topic ‘Error when export order’ 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/)

 * 12 replies
 * 3 participants
 * Last reply from: [algol.plus](https://wordpress.org/support/users/algolplus/)
 * Last activity: [3 years, 6 months ago](https://wordpress.org/support/topic/error-when-export-order/#post-16229611)
 * Status: not resolved