Firescanner Posted September 1, 2010 Share Posted September 1, 2010 Hi,I just cleaned the test-orders and set 1 as first order, list and such..The invoice is started as 1 but order as 6...How can i change the 6 into a 1?Thankx..eric Link to comment Share on other sites More sharing options...
rocky Posted September 2, 2010 Share Posted September 2, 2010 See my post here. Link to comment Share on other sites More sharing options...
Firescanner Posted September 2, 2010 Author Share Posted September 2, 2010 Hi,Yes, I already seen that post, but it won't renumber a order 6 back to a order 1.. it just tell to count from a number not renumber ordes.. or am i missing something?eric Link to comment Share on other sites More sharing options...
rocky Posted September 2, 2010 Share Posted September 2, 2010 So you've got existing orders 6, 7, 8, etc that you want to change to 1, 2, 3, etc? You'll need to use an SQL query like the following to fix that: UPDATE `ps_orders` SET `id_order` = `id_order` - 5; UPDATE `ps_order_detail` SET `id_order` = `id_order` - 5; UPDATE `ps_order_discount` SET `id_order` = `id_order` - 5; UPDATE `ps_order_return` SET `id_order` = `id_order` - 5; UPDATE `ps_order_slip` SET `id_order` = `id_order` - 5; This will subtract 5 from all the order IDs. You can then use an autoincrement query like my one above to set the next order ID. Link to comment Share on other sites More sharing options...
Firescanner Posted September 2, 2010 Author Share Posted September 2, 2010 Hi,When i run the first line, because the rest is not available or already 1, it will remove my order instead of changing them to 1?Eric Link to comment Share on other sites More sharing options...
rocky Posted September 3, 2010 Share Posted September 3, 2010 It won't delete any order. It will only subtract 5 from all the order IDs. If you have any order IDs that are less than 6, they will become less than 1 though. I'm not sure whether negative order IDs are allowed. Link to comment Share on other sites More sharing options...
Firescanner Posted September 3, 2010 Author Share Posted September 3, 2010 HI,I have orders 6 7 and 8 minus your 5.. but all orders are being deleted..?eric Link to comment Share on other sites More sharing options...
rocky Posted September 3, 2010 Share Posted September 3, 2010 They shouldn't be. That query doesn't delete any orders. It only subtracts 5 from the order ID. You can use the following query to add 5 to undo the change: UPDATE `ps_orders` SET `id_order` = `id_order` + 5; UPDATE `ps_order_detail` SET `id_order` = `id_order` + 5; UPDATE `ps_order_discount` SET `id_order` = `id_order` + 5; UPDATE `ps_order_return` SET `id_order` = `id_order` + 5; UPDATE `ps_order_slip` SET `id_order` = `id_order` + 5; Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now