• Resolved Atik

    (@onlinetravelgear)


    Hi team,

    Every time I import a list of orders that need to be updated, it ends up creating new orders instead.
    I always tick the “Update order if exists” but still it creates a new order.

    I’ve seen this behaviour for orders that have a custom status which are not already present in woocommerce by default. Meaning I can update status from Processing to Completed as both the statuses are default woocommerce status but I cannot change the status from shipped to temporary as these are custom statuses.
    Is there a way where I can update the custom statuses as well?

    The page I need help with: [log in to see the link]

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author WebToffee

    (@webtoffee)

    Hi @onlinetravelgear,

    We will check it and get back to you.

    Thread Starter Atik

    (@onlinetravelgear)

    Hi team,

    Thanks! Will wait for your response.

    Plugin Author WebToffee

    (@webtoffee)

    Hi @onlinetravelgear,

    We have released a new version of the plugin. Please update the plugin to the latest version and copy the below snippet to the active theme’s fucntions.php file. In the post_status IN line of the code, you may please provide your custom status name
    eg: In the below snippet the custom order status used is “shipped” and “temporary” so we have added ‘wc-shipped’ & ‘wc-temporary’ at the end of the code post_status IN. If you have more custom status then please add it here. Hope this is clear.

    add_filter(‘wt_orderimpexpcsv_import_order_exists_check_query’, ‘wt_orderimpexpcsv_import_order_exists_check_query’);
    function wt_orderimpexpcsv_import_order_exists_check_query($query) {
    global $wpdb;
    $query = “SELECT ID FROM $wpdb->posts WHERE post_type = ‘shop_order’ AND post_status IN ( ‘wc-pending’, ‘wc-processing’, ‘wc-completed’, ‘wc-on-hold’, ‘wc-failed’ , ‘wc-refunded’, ‘wc-cancelled’,’wc-shipped’,’wc-temporary’)”;
    return $query;
    }

    Thread Starter Atik

    (@onlinetravelgear)

    Hi there,

    My website breaks after pasting this code. I’ve also tried adding all my custom statuses and still the website breaks.
    PFA screenshot

    Plugin Author WebToffee

    (@webtoffee)

    Hi @onlinetravelgear,

    Could you please try using the snippet uploaded here and check?

    Thread Starter Atik

    (@onlinetravelgear)

    Hi team,

    I’ve added all my custom statuses to the above code and it doesn’t break the website anymore.
    However, I’m still not able to change the status for the orders that are in custom status.

    Current Plugin Version 1.7.1

    Screenshot of the message after uploading the CSV file. (It creates a new order with order ID 400808, the actual order number in the uploaded CSV is 305483)

    CSV file uploaded

    Thread Starter Atik

    (@onlinetravelgear)

    Hi team,

    Any update on this?

    Plugin Author WebToffee

    (@webtoffee)

    Hi @onlinetravelgear,

    Could you please share the import log via support. You can find the import log from Woocommerce>status>logs>order-csv-import.

    Thread Starter Atik

    (@onlinetravelgear)

    2020-11-24T07:30:46+00:00 DEBUG —[ New Import ] PHP Memory: 128 MB, WP Memory: 40 MB
    2020-11-24T07:30:46+00:00 DEBUG Parsing products CSV.
    2020-11-24T07:30:46+00:00 DEBUG Finished parsing products CSV.
    2020-11-24T07:30:46+00:00 DEBUG —
    2020-11-24T07:30:46+00:00 DEBUG Processing orders.
    2020-11-24T07:30:46+00:00 DEBUG —
    2020-11-24T07:30:46+00:00 DEBUG Processing orders.
    2020-11-24T07:30:46+00:00 DEBUG > “400797”Order Imported Successfully.
    2020-11-24T07:30:46+00:00 DEBUG > Finished importing order 400797
    2020-11-24T07:30:46+00:00 DEBUG Finished processing orders.
    2020-11-24T07:30:46+00:00 DEBUG Finished processing Orders.
    2020-11-24T07:33:05+00:00 DEBUG —[ New Import ] PHP Memory: 128 MB, WP Memory: 40 MB
    2020-11-24T07:33:05+00:00 DEBUG Parsing products CSV.
    2020-11-24T07:33:05+00:00 DEBUG Finished parsing products CSV.
    2020-11-24T07:33:05+00:00 DEBUG —
    2020-11-24T07:33:05+00:00 DEBUG Processing orders.
    2020-11-24T07:33:05+00:00 DEBUG —
    2020-11-24T07:33:05+00:00 DEBUG Processing orders.
    2020-11-24T07:33:05+00:00 DEBUG > “400808”Order Imported Successfully.
    2020-11-24T07:33:05+00:00 DEBUG > Finished importing order 400808
    2020-11-24T07:33:05+00:00 DEBUG Finished processing orders.
    2020-11-24T07:33:05+00:00 DEBUG Finished processing Orders.

    Thread Starter Atik

    (@onlinetravelgear)

    Done

    Plugin Author WebToffee

    (@webtoffee)

    Hi @onlinetravelgear,

    Could you please replace the previous snippet by copying the updated snippet from here and check if the issue is resolved or not?

    • This reply was modified 3 years, 11 months ago by WebToffee.
Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘New orders instead of updated existing orders’ is closed to new replies.