Jump to content
Latest News: (loading..)
ArtcoInc

Adding new field to orders - Best Practices

Recommended Posts

I'd like to open a discussion on the 'best practice' for adding a new field to an order. Let's say that I wanted to add a Purchase Order Number field to the order. I'll have to make changes to many areas within osC ...

 

Order Entry

Order History

Order Acknowledgement (emails)

plus any admin pages that add / display / edit orders

plus any packing slip and/or invoice pages

plus ...

 

This would require changes in many 'core files'. One *could* say that this would be a 'site specific' change, and not something that could/should be addressed in the stock code. Yet, I can see where many shops might want/need a similar 'site specific' addition to their order system.

 

So, with that in mind, what would people suggest to be the 'best practice' to add a new field to an order, and incorporate the addition throughout the shop?

 

Malcolm


If you are running the "official" osC 2.3.4 or 2.3.4.1 download, your installation is obsolete! Get the latest community-supported responsive "Edge" release here

Share this post


Link to post
Share on other sites

PS: I realize that the move to more modularization could/should help address this.

 

Malcolm

(trying to be more Wolf like)


If you are running the "official" osC 2.3.4 or 2.3.4.1 download, your installation is obsolete! Get the latest community-supported responsive "Edge" release here

Share this post


Link to post
Share on other sites

Modules would take care of some of what you want. Hooks might also be a good choice. It all depends on what parts of the osCommerce code already have the modularity you need. The Admin side would have to be hooks and/or core code mods since there are no modules.

 

The first thing to do is identify the affected pages. Find a similar database table column, or more than one in the case of orders, and search for those columns. Once you have an idea of which pages, look at each one and determine how much needs to be changed.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Moving to a more dynamic fields model could be a way to go, this would allow the option to create extra fields/labels in admin that would automatically be used in all the required instances.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×