PrestaShop Forum

The best place in the world to ask questions about PrestaShop and get advice from our passionate community!

PrestaShop Forum

Jump to content

 

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

35 replies to this topic
#1
deepee

    PrestaShop Apprentice

  • Members
  • PipPip
  • 121 posts
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
rocky

    PrestaShop Superstar

  • US Moderators
  • 9988 posts
Go to Orders > Invoices to change the next invoice number and Orders > Delivery slips to change the next delivery slip number.
Check out Nethercott Constructions for PrestaShop guides and modules. Like us on Facebook for news updates.

#3
deepee

    PrestaShop Apprentice

  • Members
  • PipPip
  • 121 posts
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
rocky

    PrestaShop Superstar

  • US Moderators
  • 9988 posts
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

Check out Nethercott Constructions for PrestaShop guides and modules. Like us on Facebook for news updates.

#5
deepee

    PrestaShop Apprentice

  • Members
  • PipPip
  • 121 posts
Hi Rocky

It worked!

Thanks very much
Deepee

#6
Alex75

    PrestaShop Newbie

  • Members
  • Pip
  • 21 posts

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
rocky

    PrestaShop Superstar

  • US Moderators
  • 9988 posts
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.
Check out Nethercott Constructions for PrestaShop guides and modules. Like us on Facebook for news updates.

#8
Alex75

    PrestaShop Newbie

  • Members
  • Pip
  • 21 posts

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
sgtbash

    PrestaShop Apprentice

  • Members
  • PipPip
  • 107 posts
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
Nineplus USA - Now on Prestashop 1.4.7

#10
Degsey

    PrestaShop Apprentice

  • Members
  • PipPip
  • 213 posts
I coupled this with the hack of making the order# and invoice# the same and it looks good

#11
Eck!

    PrestaShop Apprentice

  • Members
  • PipPip
  • 40 posts
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 Files



#12
sgtbash

    PrestaShop Apprentice

  • Members
  • PipPip
  • 107 posts
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
Nineplus USA - Now on Prestashop 1.4.7

#13
Eck!

    PrestaShop Apprentice

  • Members
  • PipPip
  • 40 posts
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
sgtbash

    PrestaShop Apprentice

  • Members
  • PipPip
  • 107 posts
Probably a good idea... I'm not sure how PS would handle reusing order numbers...

Dan
Nineplus USA - Now on Prestashop 1.4.7

#15
Eck!

    PrestaShop Apprentice

  • Members
  • PipPip
  • 40 posts
Blimey youre quick - see update.

#16
jfriday

    PrestaShop Apprentice

  • Members
  • PipPip
  • 52 posts
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 :)
<3 Jessica F

#17
121man

    PrestaShop Newbie

  • Members
  • Pip
  • 16 posts
What is the default value, just incase ?

Thanks

#18
Rigs

    PrestaShop Newbie

  • Members
  • Pip
  • 3 posts
That's awesome!! Thanks for putting this up - so much better than invoice #1!!!

#19
Konabella

    PrestaShop Apprentice

  • Members
  • PipPip
  • 42 posts

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
rocky

    PrestaShop Superstar

  • US Moderators
  • 9988 posts
Try:


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


Change database_name to the name of your database.
Check out Nethercott Constructions for PrestaShop guides and modules. Like us on Facebook for news updates.