Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Order Number Changes


Load-This

Recommended Posts

Hey Peoples,

 

Im in the middle of modifying a shop for a friend and i have run into a problem .. They want the order numbers coming from OSC to match the ones coming out of their invoice program.

 

They want them formatted as follows:

 

Order Number: 001/000001/08

 

and this is how it breaks down:

 

001 - Customers Specific Account Number

000001 - Order Number For The Year

08 - The Year

 

If anyone could help me out on this it would be greatly appreciated.

 

Cheers,

Link to comment
Share on other sites

They want them formatted as follows:

 

Order Number: 001/000001/08

 

well, first off, the orders_id column in the orders table is an integer - so it won't hold the slashes. (note: text based columns in sql tables index *much slower!!* than integer indexes. maybe not an issue if you're not processing a lot of orders every day, but you should be aware.) secondly, the column has the auto_increment attribute, so it automatically assigns new ids when records are added. this means that there is no code in oscommerce to create the order numbers, which you would need since you are not looking for a simple number. also, since you want the customers_id as part of the orders_id it probably means you'd have to require the user to log in (so you know the customer's id) before they can start adding items to their cart.

 

so in short, you'd have to change the database schema, create an orders_id generating function, and require customer login before "add to cart" buttons are activated. i'd start with that and see what else comes up during testing. you'd probably also want to look through the code wherever the orders_id is being used and make sure there isn't any code that assumes it's always an integer.

 

are they going to continue using their invoicing program? do they need to worry about collisions if they create an order in their existing software and not inside oscommerce? if so, there will be a lot more to this.

 

i hope this helps.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...