Rod Posted October 5, 2008 Share Posted October 5, 2008 I want to make the system to auto-get a order number as following:For example:Order Number: GE081005-01As 'GE' is just for shop, '08' for the ordering year 2008, '10' for the ordering month (Oct),if it is less than 10, then use 09, 08, 07 etc......., '05' for the ordering date, and the last '01' is for the No. 1st order on 2008-10-5thanks for your help in advance!!!!!!! Link to comment Share on other sites More sharing options...
Rod Posted October 6, 2008 Author Share Posted October 6, 2008 Any suggestion?????????? Link to comment Share on other sites More sharing options...
Rod Posted October 6, 2008 Author Share Posted October 6, 2008 Is there anyone can help in this.???????????????????? Link to comment Share on other sites More sharing options...
Paul C Posted October 6, 2008 Share Posted October 6, 2008 Rod, I for one can't think of a way to do it directly.The order id is currently auto-incremented in the database, and as such is a purely numeric field - one that's fundamental to the core database/application logic. I guess that you could create another field in the order table, which is a generated order reference number in the format you want, but you'd need to then add custom code whenever the order number is used for display (as that is all this would be used for).Paul Link to comment Share on other sites More sharing options...
Rod Posted October 6, 2008 Author Share Posted October 6, 2008 thanks for your message, can you let me know which file to generate the order number currently. Link to comment Share on other sites More sharing options...
Paul C Posted October 6, 2008 Share Posted October 6, 2008 It's in the classes/Order.php file, as the order id is the "id" field in the order table (if that makes sense to you??)!At around line 111 you'll see: protected $identifier = 'id_order'; Link to comment Share on other sites More sharing options...
Recommended Posts