PrestaShop Forums: [SOLVED] How To Increase The Starting Order Number to A Higher Value - PrestaShop Forums

Jump to content


Welcome to the PrestaShop Forum! We hope you'll share your comments and suggestions with us. We ask that you please post in English to the main sections of the PrestaShop Forum. If you want to write in another language, please post in the corresponding PrestaShop Community section below.

Please note that PrestaShop Community sections are largely self-moderated. PrestaShop team members may or may not participate in non-English sections. To improve the chances of receiving feedback to your question or comment, please post it in English to the main sections of our Forum.

NYC

Vous parlez français ? par ici !


[SOLVED] How To Increase The Starting Order Number to A Higher Value


[SOLVED] How To Increase The Starting Order Number to A Higher Value

#1 deepee

    PrestaShop Apprentice

  • 20 Aug 2009
  • Members
  • PipPip
  • 114 posts

Posted 23 October 2009 - 02:13 AM

Hi

I have converted an existing site to Prestashop.

When I place a test order, the order number count starts at "order #1:"

Is there a way to increase the starting order number to somewhere in the thousands, so it doesn't look like I just started a new business?

Thanks
Deepee

#2

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 23 October 2009 - 02:51 AM

Go to Orders > Invoices to change the next invoice number and Orders > Delivery slips to change the next delivery slip number.

#3

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 23 October 2009 - 03:25 AM

Thanks for your reply, Rocky.

I currently have the invoice generator turned off as we generate these separately from our accounting package but I changed the invoice number to a highervalue anyway.
I also changed the delivery slips.

When I try to place another test order I got the confirmation email with :-
"Order details
Order: #000001 placed on 2009-10-23 14:05:39
Payment: Direct Deposit"

Placed another order as a different "customer" and got:-
"Order: #000002 placed on 2009-10-23 14:18:03
Payment: Direct Deposit"

Is there anything else I need to change?

Thanks
Deepee

#4

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 23 October 2009 - 06:52 AM

I'm surprised that doesn't work. The only other thing I can think of is that it is using auto-increment to generate the order numbers. If it is, you could execute the following query on your database to set the next order number to 1000:

ALTER TABLE `ps_orders` AUTO_INCREMENT = 1000


#5

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 25 October 2009 - 04:35 AM

Hi Rocky

It worked!

Thanks very much
Deepee

#6

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 02 December 2009 - 02:24 AM

From 1256277164:

I'm surprised that doesn't work. The only other thing I can think of is that it is using auto-increment to generate the order numbers. If it is, you could execute the following query on your database to set the next order number to 1000:

ALTER TABLE `ps_orders` AUTO_INCREMENT = 1000

Rocky, could you please explain how to execute this query? What file should I look for?
Thank you very much!

#7

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 02 December 2009 - 02:31 AM

You must go to your cPanel, then select phpMyAdmin, then click the SQL button at the top-left, then enter the above query and click Go.

#8

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 08 December 2009 - 03:55 AM

From 1259717513:

You must go to your cPanel, then select phpMyAdmin, then click the SQL button at the top-left, then enter the above query and click Go.

Rocky, thank you SO much! It worked.
I really appreciate your help.
All the best,
Alex

#9

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 17 December 2009 - 05:06 PM

Thanks for the post - quite easily one of the most useful 'hacks' around.

Nothing worse than firing up a new ecommerce site and your customers receiving the first, second, third orders - looks SUPER lame!

Thanks

Dan

#10

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 29 March 2010 - 08:19 PM

I coupled this with the hack of making the order# and invoice# the same and it looks good

#11

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 28 April 2010 - 10:41 AM

Ive made a plugin for the backend for this. To use it:

1. Copy the attached file into your admin/tabs folder
2. Go to Tools/Tabs/Add New
3. Enter "Order Options" as the name
4. Enter "AdminOrderOptions" as the class
5. Select "Orders" as the parent
6. Click Save
7. Go to Orders/Order Options
8. Enter the new number you want to start with
9. Click "Change Start number"

Done.

Let me know if there are any problems I'll try and post an update.

Attached File(s)



#12

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 28 April 2010 - 10:50 AM

Cool, initially looks good, installed great although running live shop and don't want to change order number right now.

One thought, what happens if you change it to a number less than the number you are on currently? Will it throw an error, or allow 're ordering' on the same number?

Something worth testing I think although cant right now as running a live shop.

I can test it once home next week on a test environment.

Dan

#13

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 28 April 2010 - 11:05 AM

Good question - I may add a line to get the last order number and make sure its lower than the entered value. For new shops its fine though.

[Update]: Just realised, it doesnt matter if you change the autoinc value to a value less than the highest order number - the system will still take the next number and ignore autoinc, so this should be perfectly safe.

I just tried setting 1000, placing an order - OK, then setting 800 and placing an order - I got order number 1001 so no problems.

#14

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 28 April 2010 - 11:07 AM

Probably a good idea... I'm not sure how PS would handle reusing order numbers...

Dan

#15

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 28 April 2010 - 11:10 AM

Blimey youre quick - see update.

#16

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 27 May 2010 - 09:47 AM

Thanks so much to whoever posted this. I switched hosts for my shop and really wanted to keep the order numbers in sequence. Thanks again :)

#17

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 11 September 2010 - 02:43 PM

What is the default value, just incase ?

Thanks

#18

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 16 November 2010 - 05:08 AM

That's awesome!! Thanks for putting this up - so much better than invoice #1!!!

#19

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 13 December 2010 - 02:07 PM

From 1256277164:

I'm surprised that doesn't work. The only other thing I can think of is that it is using auto-increment to generate the order numbers. If it is, you could execute the following query on your database to set the next order number to 1000:

ALTER TABLE `ps_orders` AUTO_INCREMENT = 1000



Help please!!!
I use hostgator as my hosting company and followed these steps and got this error.

#1046 - No database selected
ALTER TABLE `ps_orders` AUTO_INCREMENT =2092

Please help.
Thanks in advance.

#20

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 18 December 2010 - 10:29 AM

Try:


ALTER TABLE `database_name`.`ps_orders` AUTO_INCREMENT = 2092


Change database_name to the name of your database.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users