• 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

    (@algolplus)

    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

    (@algolplus)

    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 1 year, 8 months ago by algol.plus.
    Thread Starter anhduc.bkhn

    (@anhducbkhn)

    @algolplus I just check the order

    – It was created manually
    – No shipping at all

    Plugin Author algol.plus

    (@algolplus)

    Thank you for detailed explanation.
    please, use my version of code

    Thread Starter anhduc.bkhn

    (@anhducbkhn)

    @algolplus ok, I fixed it at my side.
    wait for next release.

    Plugin Author algol.plus

    (@algolplus)

    ok, we’ll notify you

    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

    (@algolplus)

    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 1 year, 6 months ago by algol.plus.

    Hi,

    It was set as CVS by default

    Plugin Author algol.plus

    (@algolplus)

    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 ?

    Hi,

    Orders is about 1,000 ++. Same error message appeared

    Plugin Author algol.plus

    (@algolplus)

    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.