Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Resetting Order Numbers


johnm160

Recommended Posts

Hi,

 

I wanted to know if it is possible to restart you order number after testing? I have created and deleted so many orders that my numbers are at about 40.

 

I read this in the docs, but since I bought the store from someone I did not get the chance to do this.

 

 

 

Create a test order

 

Go into phpMyadmin and change the order # in table orders manually to whatever number you like. We will use 499 as an example.

 

Create another test order and the order number will automatically be 500.

 

You then must set the first test order back to it's initial value and delete it. This is necessary in order to maintain database integrity, as this value is used in more than one table.

 

Thank you,

 

John

Link to comment
Share on other sites

Create a test order

 

Go into phpMyadmin and change the order # in table orders manually to whatever number you like. We will use 499 as an example.

 

Create another test order and the order number will automatically be 500.

 

You then must set the first test order back to it's initial value and delete it. This is necessary in order to maintain database integrity, as this value is used in more than one table.

I believe the above is not to reset, but to increase the ordernr.

 

An easyer way to do the same is:

Use phpMyAdmin and execute the following query on your shop's database:

alter table orders auto_increment=999

 

"999" must be a number higher than any existing ordernumber,

the next order will be "1000"

The order number isn't reset either, but why not start at "1000" (or other high number you like) in stead of "0"?
Link to comment
Share on other sites

Brilliant!!
Thanks for the compliment :)

But actually the code was some elses idea (that's why I quoted it), otherwise I surely would not have known this either.

 

So I would rather call the osC community Brilliant!

 

Since you probably have made another test order now, you probably have to start at 10000 when you open the shop :lol:

Link to comment
Share on other sites

Since you probably have made another test order now, you probably have to start at 10000 when you open the shop :lol:

Ha Ha, Nope I ran the code with 950 for now, when I am ready to go live I will set it to my starting number.

 

 

Thanks again.

 

John

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...