Zen Cart Logo
Forums / Managing Customers and Orders / can my order number be more than just digits?

can my order number be more than just digits?

Locked

Views: 2,160

Results 1 to 15 of 15
This thread is locked. New replies are disabled.
15 Oct 2008, 7:37 PM
#1
vfrazier avatar

vfrazier

New Zenner

Join Date:
Jul 2008
Location:
Midwest
Posts:
80
Plugin Contributions:
0

can my order number be more than just digits?

I've browsed around to see if the order number that the customer receives after checking out can be made something other than just simple digits. I didn't see anything.

Can the order number be changed to something more meaningful like a date code followed by the order number?

I'd like for it to display something like 1015081 for the first order on Oct. 15, 2008.

It sure beats the heck out of order # 1, 2, 3, etc... which will make my store look like it has no traffic whatsoever. Traffic numbers should be somewhat confidential.

http://www.flyboyaccessories.com/store/

Thanks. And thanks to all who have helped me and others get this far.

16 Oct 2008, 7:19 AM
#2
fairestcape avatar

fairestcape

Totally Zenned

Join Date:
Mar 2008
Location:
Cape Town & London (depends on the season)
Posts:
2,957
Plugin Contributions:
0

Re: can my order number be more than just digits?

The order number system in Zencart is simply an arithmetic incrementing system, governed in the database table settings. I do not think it's possible to "customise" this without significant re-programming.

If you are concerned that shoppers will see their order number being, for example "# 2 ", then you can re-set the point at which your numbers start.

This is done in ADMIN>>>TOOLS>>>STORE MANAGER

You will see instructions as to how to re-set your order number to a higher initial incremental value. It's not possible to LOWER this starting point once you have made the change.

16 Oct 2008, 7:54 AM
#3
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: can my order number be more than just digits?

To make the order number meaningful, you could organize it by year, month, number or year, month, day, number:
810001 or 8101601. This will readily allow for perpetual date incrementing in the ZC order id system - in January 2010, the number will go from 912xxx to 1001xxx.

You would do the reset procedure on the first day of each month, or each morning if you want; you could write a cron job to automate it.

16 Oct 2008, 7:59 AM
#4
fairestcape avatar

fairestcape

Totally Zenned

Join Date:
Mar 2008
Location:
Cape Town & London (depends on the season)
Posts:
2,957
Plugin Contributions:
0

Re: can my order number be more than just digits?

That's a clever idea Glenn, and I was thinking of offering it up as a suggestion, but didn't because of my initial perception that it would require rigorous manual intervention - but as a cron job... well, that's a clever way round the manual intervention.

16 Oct 2008, 1:18 PM
#5
vfrazier avatar

vfrazier

New Zenner

Join Date:
Jul 2008
Location:
Midwest
Posts:
80
Plugin Contributions:
0

Re: can my order number be more than just digits?

I like the idea of a cron job to update the numbers each day. I took a look at the cron jobs tab on my hosting site and immediately became a cow staring at a passing train. So, realistically there isn't much chance of it happening due to my complete lack of Linux knowledge of any sort.

But thanks for the tips and the confirmation that I should simply set the number to something other than 2. I'll do that instead.

16 Oct 2008, 2:03 PM
#6
merlinpa1969 avatar

merlinpa1969

Totally Zenned

Join Date:
Mar 2004
Posts:
13,031
Plugin Contributions:
4

Re: can my order number be more than just digits?

thats a good idea

another thing to consider is that by resetting the number every day,
you start to have gaps in order numbers...

while this can be explained away, ( incase of an audit )

the less you have to talk to the irs the better.

14 Apr 2010, 3:33 PM
#7
mzimmers avatar

mzimmers

Zen Follower

Join Date:
May 2008
Posts:
453
Plugin Contributions:
0

Re: can my order number be more than just digits?

I was wondering about this, too. I see the thread's a bit old...has anyone done anything since this? I really like the idea of prepending a numerical date code to an order ID, but I'm not sure I want to rely on a cron job for it.

Thanks for any ideas.

14 Apr 2010, 4:38 PM
#8
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: can my order number be more than just digits?

There have been threads describing the process of adding text or numbers to the order id when it is displayed, in admin, accounts, e-mails...
This has the bookkeeping benefit of not interrupting the order id sequence, while giving something meaningful to identify the store/source.

Actually having a date code as part of the id is another matter.

14 Apr 2010, 4:48 PM
#9
mzimmers avatar

mzimmers

Zen Follower

Join Date:
May 2008
Posts:
453
Plugin Contributions:
0

Re: can my order number be more than just digits?

Yeah, I just wrote a little php function to prepend a numeric date representation to the order ID on the shipping label. I guess this will have to do for now.

If I wanted to put this function somewhere accessible to other modules I might want to modify (like the packing slip and even the screen display), where would I put it? I can't override the functions directory, can I?

Thanks.

14 Apr 2010, 4:52 PM
#10
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: can my order number be more than just digits?

/includes/functions/extra_functions/

14 Apr 2010, 4:54 PM
#11
mzimmers avatar

mzimmers

Zen Follower

Join Date:
May 2008
Posts:
453
Plugin Contributions:
0

Re: can my order number be more than just digits?

Really? I can give the file any name I want, and just put it in that directory? Cool! Thanks.

14 Apr 2010, 4:55 PM
#12
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: can my order number be more than just digits?

FYI, v2.0 has a built-in ability to configure how order numbers will render. Just something to look forward to down the road :blush:

14 Apr 2010, 5:03 PM
#13
mzimmers avatar

mzimmers

Zen Follower

Join Date:
May 2008
Posts:
453
Plugin Contributions:
0

Re: can my order number be more than just digits?

OK, I just moved my function out of the shipping label file, and into its own file in extra_functions. I got an undefined function error message. Do I need to use a require statement, or define the function as global or something, or what?

Thanks.

14 Apr 2010, 9:35 PM
#14
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: can my order number be more than just digits?

My experience is that functions in /extra_functions/ files are available automatically. The only way they would not be is for some file accessed very early in the page building process - long before any shipping files should be executing, I would think.

It is possible that you are dealing with an admin file, which may need its functions to be in /admin/includes/functions/extra_functions/.

14 Apr 2010, 9:43 PM
#15
mzimmers avatar

mzimmers

Zen Follower

Join Date:
May 2008
Posts:
453
Plugin Contributions:
0

Re: can my order number be more than just digits?

Thanks, Glenn. The file is the Super Order super_shipping_label.php, which indeed is under the admin directory. I put the file into admin/includes/functions/extra_functions, and it seems to be picking up just fine now.