Is this possible?
Change Order Status on 250 orders via SQL
I need to change them from Queued to Ship [5] to Shipped [4]
Printable View
Is this possible?
Change Order Status on 250 orders via SQL
I need to change them from Queued to Ship [5] to Shipped [4]
Yes it's possible. See Similar Threads list below.
Is this a one-time thing, that you'll never need to do again?
Is there a bigger problem to solve?
How did you arrive at this situation?
All those posts are 10 years old and don't work, and the addon isn't made for current versions...
Is there a SQL command I can use to change the status of all current orders from one status to another, if so, do you know how? If so, can you tell me?
I feel like I'm going around in circles asking for help here.
What do you mean by "don't work"?
Did you get a big blue-screen-of-death when you tried it? Or did it simply cause a specific unexpected outcome? What was that?
... which begs the question: which Zen Cart version are *you* using?
Why do you assume it's not important information, even when you're given 2 invitations to provide it when making a post?
Come to think of it, me too.
It's totally frustrating when people don't post the bigger context of their question when asking for help. Especially when they've been around for years.
And then even moreso when they still don't answer the questions asked when they come back complaining that they didn't like the suggestion given.
If you don't care about history then you can run:
Code:UPDATE orders SET orders_status=4 WHERE orders_status=5
And, while that would be technically correct, it is also incomplete depending on the circumstance, as it doesn't also update the history of each affected order to indicate when/why the change. One of the Similar Threads contains some SQL that goes down the road of adding history records too, so I'd hoped you'd explore that in relation to your needs, adjusting to handle the multiple history records.
It also wouldn't send an email to the customer indicating the change. But you didn't say whether you cared about that part. The assumption is you didn't intend to send an email.
Your post asks for an SQL query, but if you want the benefit of the history update and maybe the optional email, it is easier to use a PHP loop to identify all the affected orders and then for each update their status by calling zen_update_orders_history() which is in includes/functions/functions_osh_update.php. You didn't post your Zen Cart version, so I don't know whether you have the most recent functions available in your code.
And you didn't answer my question about how you came to be in this situation and whether this is a one-time thing or something you expect to do frequently, so I don't know whether it's worth my trouble to go digging around about plugins that might do all this for you, vs just handle a quick cleanup of something.