Results 1 to 10 of 10
  1. #1
    Join Date
    May 2006
    Posts
    1
    Plugin Contributions
    0

    How to reset Order ID backward

    I've set the Order ID to it's maximum value (signed interger).

    Since the order ID in my previous store is in integer...

    Now my zen cart store can't make any new order and error "Duplicated Key" is shown.

    Please advise how to reset this order ID backward. Thanks.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: How to reset Order ID backward

    how many records are in your orders table?
    .
    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
    Jun 2008
    Posts
    1
    Plugin Contributions
    0

    Default Re: How to reset Order ID backward

    I have the exact same problem. I am just about to launch the store, and did a Reset Order ID to a 14 digit number. The next number was 2147483647, and the following generated an error due to it being a duplicate.

    I went into my SQL admin and changed all references to 2147483647 to a lower number, like 10 (I only have 6 test orders so far). The problem is no matter what I do, the next order is again 2147483647.

    I've tried setting the number lower in SQL and running the RESET ORDER ID in STORE MANAGER again 1 number ahead, but it's not working.

    Is there any way I can just reset this order number to 0 and from there I can set it to whatever I need?

    Scott.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: How to reset Order ID backward

    Truncate all tables related to orders. That will wipe out all order history, so be sure that's what you really want to do.

    http://www.zen-cart.com/wiki/index.p...#Order_History
    .
    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
    Aug 2007
    Posts
    31
    Plugin Contributions
    0

    Default Re: How to reset Order ID backward

    DrByte,

    please assist - how do u truncate - which tables (all of them listed in the link under orders?). pleas ehelp...same problem here as well.

  6. #6
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: How to reset Order ID backward

    Truncate is equivalent to the "Empty" option in phpMyAdmin.
    .
    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

    Default Re: How to reset Order ID backward

    Hi,

    I've got the same problem...

    I 've tried to empty impacted tables (zen_orders ...) as you said DrByte but when i test a new command, the number is always 2147483647..

    Is there another table to impact or maybe using fix cache key to solve this ???

    Thanks in advance for any clue or help

  8. #8

    Default Re: How to reset Order ID backward

    Ok found it,

    after emptying orders tables you must also change the auto_increment in th db :"ALTER TABLE zen_orders AUTO_INCREMENT = 50" (if you want to restart your id from 51...)

  9. #9
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: How to reset Order ID backward

    Using the "delete" option should "truncate" the tables, and automatically reset the auto-increment counter. It also does some housekeeping and is a more efficient "cleaning" than doing mass deletes.

    If you simply deleted numerous records, that will not reset the auto-incrementer, and thus you'd have to do that part manually as you indicated.
    .
    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.

  10. #10

    Default Re: How to reset Order ID backward

    Okay, did not know the difference, but i'll use it !

    Thanks for the information DrByte

 

 

Similar Threads

  1. How to Reset the Order ID back to 1 ?
    By HeyIts007 in forum General Questions
    Replies: 4
    Last Post: 5 Sep 2011, 06:17 PM
  2. How can I reset order number?
    By gsmsalers in forum General Questions
    Replies: 5
    Last Post: 12 Jan 2011, 06:00 PM
  3. Reset Order ID
    By pjbonarrigo in forum General Questions
    Replies: 4
    Last Post: 25 Jun 2009, 07:48 PM
  4. Reset Current Order ID problem?
    By jonb in forum General Questions
    Replies: 3
    Last Post: 21 Mar 2008, 12:48 AM
  5. reset order number
    By styledata in forum Customization from the Admin
    Replies: 1
    Last Post: 15 Jun 2006, 09:27 PM

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