Results 1 to 4 of 4
  1. #1
    Join Date
    May 2016
    Location
    Ohio
    Posts
    407
    Plugin Contributions
    0

    Default Change Order Status on 250 orders via SQL

    Is this possible?

    Change Order Status on 250 orders via SQL

    I need to change them from Queued to Ship [5] to Shipped [4]

  2. #2
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Change Order Status on 250 orders via SQL

    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?
    .

    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.

  3. #3
    Join Date
    May 2016
    Location
    Ohio
    Posts
    407
    Plugin Contributions
    0

    Default Re: Change Order Status on 250 orders via SQL

    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.

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

    Default Re: Change Order Status on 250 orders via SQL

    Quote Originally Posted by jmberman View Post
    All those posts ... don't work
    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?

    Quote Originally Posted by jmberman View Post
    and the addon isn't made for current versions...
    ... 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?

    Quote Originally Posted by jmberman View Post
    I feel like I'm going around in circles asking for help here.
    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.

    Quote Originally Posted by jmberman View Post
    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?
    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.
    .

    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.

 

 

Similar Threads

  1. v153 Product is Free, Free Shipping Orders - How to change Order Status
    By Matt Staines in forum Customization from the Admin
    Replies: 3
    Last Post: 13 Apr 2016, 09:08 AM
  2. v138a Auto update Order Status via barcode on invoice
    By sbbemn in forum All Other Contributions/Addons
    Replies: 12
    Last Post: 29 May 2012, 02:05 PM
  3. Bulk change to order status using SQL query for certain products?
    By neo2810 in forum Managing Customers and Orders
    Replies: 3
    Last Post: 24 Feb 2012, 08:34 PM
  4. Change all orders from status 'x', to status 'y'.
    By bi11i in forum Customization from the Admin
    Replies: 3
    Last Post: 22 Jul 2011, 06:49 AM
  5. How to get order status via php?
    By breadfan in forum General Questions
    Replies: 6
    Last Post: 14 Sep 2007, 10:20 PM

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