Sometimes there's a requirement for some new attributes for orders in a Magento store. The reasons may be different, extend functionality of Magento categories or simply to store more information about your online customers. This enables you to customize the checkout page in your store and make customers happier.
If you are a developer, then you must know adding custom product attribute for orders is pretty a common task. If you are facing problem with this task, we will be very much glad when you find this information helpful.
Here are some quick steps and tips to create new attributes for orders in Magento store which will do exactly what you want and nothing more than that. So let’s start with it:
For Adding new attribute, we have to create new column for new attribute field in “sales_flat_order” and “sales_flat_quote”.
This can be done by two ways.
Firstly by creating custom module using Module Mysql setup file (file path- /app/code/local/softprodigy/customattribute/sql/customattribute_setup/mysql4-install-1.1.php)
Here (Softprodigy -NameSpace, customattribute-Module)
Secondly, if you don't want to create your own module simply create a php file in the project’s root folder with the below code and run this file manually.
Then finally get our custom order attribute value in backend by editing following file with add following code-app/design/adminhtml/default/default/template/sales/order/view/info.phtml