Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Change the order number


Guest

Recommended Posts

I have searched and searched and not found any help for this issue. When I did my first test order the order number was 1. How can I change the order numbers that are assigned so that they start at 1000 or something?

Link to comment
Share on other sites

I have searched and searched and not found any help for this issue. When I did my first test order the order number was 1. How can I change the order numbers that are assigned so that they start at 1000 or something?

You can edit the order number of the last order in phpmyadmin

Link to comment
Share on other sites

You can edit the order number of the last order in phpmyadmin

 

I went there already and it says "locked by OSCommerce". I did not try to log in and attempt to modify it.

Link to comment
Share on other sites

I went there already and it says "locked by OSCommerce". I did not try to log in and attempt to modify it.

It would not say that if you opened phpmyadmin and selected the database.

 

You may have seen

 

MySQL databases

You can maintain any of your databases using any user created with any MySQL GUI client. You can also use the integrated phpMyAdmin control panel by clicking its link from the manage database screen.

 

on the page where it says the database is locked. That is not phpmyadmin.

Link to comment
Share on other sites

It would not say that if you opened phpmyadmin and selected the database.

 

You may have seen

 

MySQL databases

You can maintain any of your databases using any user created with any MySQL GUI client. You can also use the integrated phpMyAdmin control panel by clicking its link from the manage database screen.

 

on the page where it says the database is locked. That is not phpmyadmin.

 

Thanks, I am not sure where I went the first time but your advice is going to let me in. I appreciatr the quick response.

Link to comment
Share on other sites

  • 1 month later...

I also need to do this. The client is using quickbooks and already has many orders processed. They are switching from another online store to OS Commerce, which is up and running.

 

She will give me an order number to begin with - let's just say it's 200

 

I need to change it in the database, but there are so many tables with "orders_id" in them

 

Right now we have 4 test orders. So I changed all the orders_id from 4 to 200, but when I went back into the OS Commerce admin panel, it still shows orders 1-4.

 

I realize it's possible that it's just listing the orders currently there, and if she exported them all tonight, that tomorrow it would start again at 1 (even though the order id would be 5) - I can't see how it exports so I'm not sure exactly how it's displaying.

 

It would be great if I could change the initial (beginning) order number to 200 and then also display it in the backend.

 

I hope this isn't confusing but you guys are wizards :)

 

Any help much appreciated. Need to get this done today. Thanks!

☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆

Link to comment
Share on other sites

ok i actually just went in and did this myself. i guess i've worked so much with stuff over the years i can kinda figure it out. :D

 

what i did was went in and change the existing order 4 (of our test orders) to be order 199, so that the next order will be #200 and that's what the client wanted to start with.

 

here is the code, i'll start yours at 999

go into phpmyadmin and run this. make backups! even though you could undo this easily.

 

UPDATE `yourdbname`.`orders_total` SET `orders_id` = '999' WHERE `orders_id` = 1; 
UPDATE `yourdbname`.`orders_status_history` SET `orders_id` = '999' WHERE `orders_id` = 1;
UPDATE `yourdbname`.`orders_products` SET `orders_id` = '999' WHERE `orders_id` = 1;
UPDATE `yourdbname`.`orders` SET `orders_id` = '999' WHERE `orders_id` = 1;

 

so change yourdbname to the name of your database

change 1 to whatever your existing last order is, like if you had 4 test orders like we did, change the 1 to a 4

 

if you don't have an order, either put one in there, or i don't know what.

 

also, there is a tip on this forum about HOW TO SHOW THE ORDER ID in your admin control panel of OS Commerce, so if you do that as well, you can actually SEE the order number and you'll know it went through.

 

Edit: here's the thread

http://www.oscommerce.com/forums/index.php?sho...=273070&hl=

☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆

Link to comment
Share on other sites

Actually in the documentation, there's a much faster way of doing this. I'm surprised nobody corrected me. Simply enter the following line into your database to give the NEXT ORDER a new number:

 

alter table orders auto_increment = 1000;

 

done!

☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...