Forums / Managing Customers and Orders / Increase Order Number increment amount?

Increase Order Number increment amount?

Views: 1,681

Results 1 to 5 of 5
8 Apr 2025, 2:54 PM
#1
cosmosk avatar

cosmosk

Zen Follower

Join Date:
Jan 2015
Posts:
193
Plugin Contributions:
0

Increase Order Number increment amount?

Hi, I know how to manually set my next order number, but I'm wondering if I can change it to increment by 3 or something instead of 1 each time. i saw a thread on random numbers, but I'd like to achieve something more basic. Is there a piece of code where I can change a 1 to a 3 somewhere?

Thanks

8 Apr 2025, 3:24 PM
#2
mprough avatar

mprough

Totally Zenned

Join Date:
Nov 2007
Location:
Woodbine, Georgia, United States
Posts:
4,305
Plugin Contributions:
39

Re: Increase Order Number increment amount?

CosmosK:

Hi, I know how to manually set my next order number, but I'm wondering if I can change it to increment by 3 or something instead of 1 each time. i saw a thread on random numbers, but I'd like to achieve something more basic. Is there a piece of code where I can change a 1 to a 3 somewhere?

Thanks

That's a big deal to change as the incremental status stores the order info in your database. There really isn't a security to gain from this.

8 Apr 2025, 3:58 PM
#3
cosmosk avatar

cosmosk

Zen Follower

Join Date:
Jan 2015
Posts:
193
Plugin Contributions:
0

Re: Increase Order Number increment amount?

mprough:

That's a big deal to change as the incremental status stores the order info in your database. There really isn't a security to gain from this.

How is that a bigger deal than resetting the number manually? Why would the database care if there are skips?

8 Apr 2025, 4:40 PM
#4
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,729
Plugin Contributions:
56

Re: Increase Order Number increment amount?

Is there a piece of code where I can change a 1 to a 3 somewhere?

It's not done in code; it's done by the database. I have read you can modify the auto_increment value but I have never done this myself. Be sure to make a backup first and verify that everything works as expected. It would be a good idea to verify this on a test site before changing your live database. Be sure to test all relevant payment methods.

The syntax would be something like this:

ALTER TABLE orders MODIFY COLUMN orders_id int(11) NOT NULL auto_increment=3;

OR perhaps just

ALTER TABLE orders auto_increment=3;

I would not recommend doing this but it's your store.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

8 Apr 2025, 4:50 PM
#5
cosmosk avatar

cosmosk

Zen Follower

Join Date:
Jan 2015
Posts:
193
Plugin Contributions:
0

Re: Increase Order Number increment amount?

Hmm, I was hoping it was an integer value somewhere in a php file. Maybe I'll wait, but thank you for the response. I'll use the time I would have spent attempting it to manually update the counter to keep my paranoia at bay. Thanks