If this is your first visit, check our documentation. To post, register or login.

Modifying the order ID

Started by ultimate_zc on 3 Feb 2013, 8:19 AM · Views: 846

Results 1 to 4 of 4
3 Feb 2013, 8:19 AM
#1
ultimate_zc avatar

ultimate_zc

Zen Follower

Join Date:
Jun 2008
Location:
Osprey, Florida
Posts:
147
Plugin Contributions:
7

Post #1 by ultimate_zc

Is there a way to modify the order ID so that orders received through my desktop site remain as they are and orders made through my mobile site could have a prefix added?

i.e. Invoice No. mobile-10

I figure if I could add a mobile detection script the admin perhaps would know whether the order is being placed from a mobile device however, I'm concerned about totally ruining the database.

3 Feb 2013, 8:42 AM
#2
gilby avatar

gilby

Totally Zenned

Join Date:
Aug 2005
Location:
Vic, Oz
Posts:
1,816
Plugin Contributions:
0

Post #2 by gilby

Order ID's are numeric and auto incrementing and really shouldn't be played with.
Add another field to the orders table to store whether it's a mobile order or not.
Then test this field where needed to add your pseudo "mobile-" prefix as required

3 Feb 2013, 6:35 PM
#3
swguy avatar

swguy

Administrator

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

Post #3 by swguy

ultimate_zc:

...
I figure if I could add a mobile detection script the admin perhaps would know whether the order is being placed from a mobile device...

You want to add it on the catalog side though, not the mobile side, so you capture this information when the order is placed. Take a look at SMS on Sale in the Plugins area to see how to inject some logic into the order creation process without having to change core files.

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.

5 Feb 2013, 7:10 AM
#4
ultimate_zc avatar

ultimate_zc

Zen Follower

Join Date:
Jun 2008
Location:
Osprey, Florida
Posts:
147
Plugin Contributions:
7

Post #4 by ultimate_zc

Thanks. I'll give that a try and let you know how it works out.