Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Jun 2004
    Posts
    113
    Plugin Contributions
    0

    Default Set all Processing orders to Delivered? Or delete all orders?

    Hi,

    Is there an easy way to set all orders with 'Processing' status to 'Delivered'? I have a hundred-some and one-by-one would be a pain. I might be able to handle some SQL code if that's the way.

    Alternately, can I delete all existing orders easily? We run an annual event and all were delivered last summer (the 100-some are the ones at will-call).

    Or maybe I can add a 5th status 'History' and set all orders to that? I'd really like this solution but if it's too much trouble I'll be happy with one of the above.

    Thanks!

  2. #2
    Join Date
    Jun 2004
    Posts
    113
    Plugin Contributions
    0

    Default Re: Set all Processing orders to Delivered? Or delete all orders?

    I figured out how to add the 5th order status, History, but am still wondering about a good way to do a bulk change to that status. Any tips appreciated!

  3. #3
    Join Date
    Jun 2004
    Posts
    113
    Plugin Contributions
    0

    Default Re: Set all Processing orders to Delivered? Or delete all orders?

    In case it helps someone later, I believe I did this correctly with an SQL query in PHPMyAdmin:

    UPDATE orders SET orders_status=3 WHERE orders_status=2

    In that sample, all orders records with the orders_status of 2 (Processing) have their orders_status field changed to 3 (Delivered).

  4. #4
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Set all Processing orders to Delivered? Or delete all orders?

    Quote Originally Posted by Brian1234 View Post
    In case it helps someone later, I believe I did this correctly with an SQL query in PHPMyAdmin:

    UPDATE orders SET orders_status=3 WHERE orders_status=2

    In that sample, all orders records with the orders_status of 2 (Processing) have their orders_status field changed to 3 (Delivered).
    And, by so-doing, you've now corrupted all your order data because there is no corresponding order_status_history record to match and validate the changes you've made to the raw data. Thus, the orders will no longer show correctly in your admin area, and may not display consistently in the customers' My Account area.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Jun 2004
    Posts
    113
    Plugin Contributions
    0

    Default Re: Set all Processing orders to Delivered? Or delete all orders?

    augh! I did make a backup first though.

    So back to the original question. How to properly change order status in bulk (or just properly delete all existing orders, we really don't need the orders from 2008 in there!) ?

  6. #6
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Set all Processing orders to Delivered? Or delete all orders?

    To properly update the order status, one must not only update the orders table to the new status, but also add a new record to the orders_status_history table for *each* record, showing the new status which you've updated the orders table record to have.

    There is no built-in automated method of that in v1.3.8.
    Same with purging old orders.

    You could explore whether there might be some addons that offer bulk updating or purging. However, those would likely also alter many core files to add other additional functionality also, which may or may not be something you wish to complicate your site with.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #7
    Join Date
    Jun 2004
    Posts
    113
    Plugin Contributions
    0

    Default Re: Set all Processing orders to Delivered? Or delete all orders?

    Yes, I gathered that, but I was hoping for more info on 'how to'. Can you point me to any particularly good threads that discuss how to properly change orders_status and order_status_updates to match? If there's more to it than those, I guess I'll be doing 130+ manually.

  8. #8
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Set all Processing orders to Delivered? Or delete all orders?

    you simply add a NEW order-status-history record for each order you are updating
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  9. #9
    Join Date
    Jun 2004
    Posts
    113
    Plugin Contributions
    0

    Default Re: Set all Processing orders to Delivered? Or delete all orders?

    OK, thanks! Would you take a look and see if this looks appropriate for zen-cart?

    INSERT INTO orders_status_history (orders_id, orders_status_id, date_added, customer_notified, comments)
    VALUES ($id, 5, '2010-03-03 23:00:00', 0, 'order status was changed to History by Brian')

    There, $id represents the number of each actual order I have changed the status of. The rest of the fields would be static values exactly as shown where 5 is my custom History status, then that datetime, notification value and comment.

    I'm not touching orders_status_history_id in the statement because it's an auto_increment and I think it will handle itself. I'm seeing some indexes (PRIMARY and idx_orders_id_status_id_zen) but am unsure if I have to do anything with those.

  10. #10
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Set all Processing orders to Delivered? Or delete all orders?

    That should be fine.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v150 Remove ALL customers and ALL orders before a certain date and reset counter history.
    By hawkwynd in forum Managing Customers and Orders
    Replies: 4
    Last Post: 10 Dec 2013, 03:22 AM
  2. Delete all orders
    By bonheddwr in forum General Questions
    Replies: 2
    Last Post: 30 May 2013, 10:15 AM
  3. Reset store: Delete all orders, customers, etc.
    By flix in forum Managing Customers and Orders
    Replies: 16
    Last Post: 31 Oct 2012, 08:04 PM
  4. HELP - Starting today all paypal orders creates 2 orders
    By keylesslocks in forum General Questions
    Replies: 1
    Last Post: 28 Jan 2009, 12:59 AM
  5. How can I add on a set price to all international orders??
    By Snype in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 4 Sep 2008, 11:47 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR