Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2011
    Posts
    9
    Plugin Contributions
    0

    Default Bulk change to order status using SQL query for certain products?

    I have a site with only 5 products (they will change regularly but the product ID will remain the same as I'll just be changing the detail). I want to be able to change, in bulk, the status for each product from
    "pending" to "processed".

    I've seen the SQL query to change ALL pending products to processed so can someone tell me what string I need to add to apply to specific product ID?

    This is what I think will do it for all products:

    UPDATE orders SET orders_status=2 WHERE orders_status=1
    INSERT INTO orders_status_history (orders_id, orders_status_id, date_added, customer_notified, comments)
    VALUES ($id, 2, '2010-03-03 23:00:00', 0, 'order status was changed to History by Admin')

    So do I need something like
    (excuse my lack of SQL knowledge):

    UPDATE orders SET orders_status=2 FOR products_id=6 WHERE orders_status=1
    INSERT INTO orders_status_history (orders_id, orders_status_id, date_added, customer_notified, comments)
    VALUES ($id, 2, '2010-03-03 23:00:00', 0, 'order status was changed to History by Admin')

    And one more thing. Instead of the hardcoded date, what string variable can I insert to use that day's date instead: "'DATETIME: Auto NOW()', NOW()"?

  2. #2
    Join Date
    Mar 2005
    Posts
    70
    Plugin Contributions
    0

    Default Re: Bulk change to order status using SQL query for certain products?

    you could try this , no promises though

    UPDATE orders SET orders_status=2 WHERE products_id=6 && orders_status=1
    INSERT INTO orders_status_history (orders_id, orders_status_id, date_added, customer_notified, comments)
    VALUES ($id, 2, '2010-03-03 23:00:00', 0, 'order status was changed to History by Admin')
    Last edited by zskiman; 13 Sep 2011 at 02:17 PM. Reason: spelling change

  3. #3
    Join Date
    Mar 2011
    Posts
    9
    Plugin Contributions
    0

    Default Re: Bulk change to order status using SQL query for certain products?

    Thanks for trying bud, but that failed...

  4. #4
    Join Date
    Feb 2012
    Location
    connecticut
    Posts
    3
    Plugin Contributions
    0

    Default Re: Bulk change to order status using SQL query for certain products?

    Any update on this? Can't find any help. Thanks!

 

 

Similar Threads

  1. Is bulk change of order status possible?
    By dduane in forum Basic Configuration
    Replies: 10
    Last Post: 11 Jul 2021, 03:37 PM
  2. v151 Need an SQL query to select a range of products and update the product status to 0
    By oztraveller06 in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 8 Mar 2014, 07:33 AM
  3. Delete Old Order IDs 1 to 3369 Using SQL Query
    By limelites in forum General Questions
    Replies: 1
    Last Post: 12 Apr 2013, 02:29 PM
  4. Change order status to complete to delivered for downloadable products
    By designerman in forum Setting Up Categories, Products, Attributes
    Replies: 12
    Last Post: 14 Apr 2009, 05:50 PM
  5. Replies: 2
    Last Post: 8 Jan 2009, 01:00 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