Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

resetting order numbers


Guest

Recommended Posts

IS it possible to reset order numbers. Ive setup the cart and in the process of getting things right and testing i have generated order numbers but now the site is finished i need to set these back to 0 or whatever.

Anyone know which file these are in or is it a database jobie ?

 

Thanks

BTW I have done a full search with no luck, just two unanswered posts.

Praying for better luck :rolleyes: Please.

Link to comment
Share on other sites

This is definately a db thing. The other day I came across a forum post that provided a query that set the db to empty. For your purpose you would need to modify the query so it doesn't remove your products info.

 

I don't recall where the post was but here is the query as posted:

 

#If you need to reset a database to empty (no products but keeping the configuration settings),

#then take the following and paste it into a PHPMyAdmin sql window and you should be good to go.

#

#Another alternative would be to copy and paste the information into a file called reset_db.sql

#and simply load that file every time you needed to clean a database.

#CODE

 

 

DELETE FROM `address_book`;

 

DELETE FROM `banners`;

 

DELETE FROM `banners_history`;

 

DELETE FROM `categories`;

 

DELETE FROM `categories_description`;

 

DELETE FROM `counter`;

 

DELETE FROM `customers`;

 

DELETE FROM `customers_basket`;

 

DELETE FROM `customers_info`;

 

DELETE FROM `manufacturers`;

 

DELETE FROM `manufacturers_info`;

 

DELETE FROM `orders`;

 

DELETE FROM `orders_products`;

 

DELETE FROM `orders_status_history`;

 

DELETE FROM `orders_total`;

 

DELETE FROM `products`;

 

DELETE FROM `products_attributes`;

 

DELETE FROM `products_attributes_download`;

 

DELETE FROM `products_description`;

 

DELETE FROM `products_notifications`;

 

DELETE FROM `products_options`;

 

DELETE FROM `products_options_values`;

 

DELETE FROM `products_options_values_to_products_options`;

 

DELETE FROM `products_to_categories`;

 

DELETE FROM `reviews`;

 

DELETE FROM `reviews_description`;

 

DELETE FROM `sessions`;

 

DELETE FROM `specials`;

 

DELETE FROM `whos_online`;

 

 

 

ALTER TABLE banners AUTO_INCREMENT = 1;

 

ALTER TABLE banners_history AUTO_INCREMENT = 1;

 

ALTER TABLE categories AUTO_INCREMENT = 1;

 

ALTER TABLE customers AUTO_INCREMENT = 1;

 

ALTER TABLE customers_basket AUTO_INCREMENT = 1;

 

ALTER TABLE customers_basket_attributes AUTO_INCREMENT = 1;

 

ALTER TABLE manufacturers AUTO_INCREMENT = 1;

 

ALTER TABLE manufacturers_info AUTO_INCREMENT = 1;

 

ALTER TABLE orders AUTO_INCREMENT = 1;

 

ALTER TABLE orders_products AUTO_INCREMENT = 1;

 

ALTER TABLE orders_status_history AUTO_INCREMENT = 1;

 

ALTER TABLE orders_total AUTO_INCREMENT = 1;

 

ALTER TABLE products AUTO_INCREMENT = 1;

 

ALTER TABLE products_attributes AUTO_INCREMENT = 1;

 

ALTER TABLE products_description AUTO_INCREMENT = 1;

 

ALTER TABLE products_options_values_to_products_options AUTO_INCREMENT = 1;

 

ALTER TABLE reviews AUTO_INCREMENT = 1;

 

ALTER TABLE specials AUTO_INCREMENT = 1;

 

Obviously you would need to modify this to meet your requirements and before you even think of getting into this use the admin function to BACK UP YOUR DATABASE!!! Just in case something goes wrong you can restore your previous db.

 

Maybe someone can help you out with the changes to the query. I'd love to but I've got a meeting shortly and am looking for some answers myself.

 

Good Luck,

 

Tim Fortune

How do you know when you know what you want to do for the rest of your life?

Link to comment
Share on other sites

:o!!

Thats not what i needed to hear :(, i know didly about db's (just done a two week PHP learning curve and simply don't have the spare time to learn dbs as well ATM.

Its just i know the accountant will be humpy about the order numbers not being in order as the tax man will probably think we,ve been diddling the books.

Order numbers ATM are around the 80 mark with about six of them being actual orders and the rest deleated which if possible i would like to be numbered 1 to 6 and then carry on from there.

If anyones feeling generous with there time and experiance i'll have a go with a little more information.

 

Anyone ? :D

Link to comment
Share on other sites

I don't mean to be real snippity but you shouldn't have opened your store for orders until it was ready.

 

Anyway you can delete the other orders manually from the admin panel which will leave you with what you need other than the order numbers you want.

 

As far as your accountant goes they can easily make a notation in the books as to the cause of the missing order numbers that will satisfy any queries as to the missing information.

 

I suggest you just call your accountant and explain the situation and see what he reccommends.

 

You could also run this stripped down query:

 

DELETE FROM `orders`;

 

DELETE FROM `orders_products`;

 

DELETE FROM `orders_status_history`;

 

DELETE FROM `orders_total`;

 

 

ALTER TABLE orders AUTO_INCREMENT = 1;

 

ALTER TABLE orders_products AUTO_INCREMENT = 1;

 

ALTER TABLE orders_status_history AUTO_INCREMENT = 1;

 

ALTER TABLE orders_total AUTO_INCREMENT = 1;

 

and then place your six orders back in manually which will give you the numbering you want.

 

I don't know much about php or mysql either but I do stuff like this all the time. Just back up your db in the admin panel first. If you look at the tables in your back up you could pretty easily recreate them the way you want just by matching the numbers and fields.

 

If you wait for a db guru to give you the query you need that will actually work you could be waiting a long time and maybe never get a answer.

 

I think for the most part a major percentage of the folks in the forum are no different than you and I. I have posted many times and never recieved answers so I try to help where I can. It what makes the system work and it works pretty well.

 

You may also want to consider posting in a forum where the mysql gurus hang out you may have better luck there. Those folks eat, sleep and breath queries.

 

I wish I could be of greater help,

 

Tim Fortune

How do you know when you know what you want to do for the rest of your life?

Link to comment
Share on other sites

I don't mean to be real snippity but you shouldn't have opened your store for orders until it was ready.

 

I thought it was.

Did,nt have too much of a problem with the order numbers starting higher as long as they followed on from there ,unfortunatly we had a couple of paypal payments that did,nt register on Paypal but did on the cart so had to be deleated which made things look much worse. Now that problem has been sorted i would have liked to tidy things up.

Thanks very much for the feedback though most apreciated.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...