MAGENTO

Add additional attributes in order grid in magento

Sometimes it required to add more than given fields to in order grid so as to filter orders efficiently as per requirement. To add additional attributes in order grid in magento following are the steps –

Add additional attributes in order grid in magento

Create a module  Custom with package Order with file \app\code\local\Custom\Order\etc\config.xml

 

Create block with grid file

app\code\local\Custom\Order\Block\Adminhtml\Order\Grid.php

Create those two attributes by running sql install script

\app\code\local\Custom\Order\sql\order_setup\mysql4-install-0.1.0.php

Now run the script so as to obtain an upgraded order grid like this –

Add additional attributes in order grid in magento
Add additional attributes in order grid in magento

Create Helper Data file

\app\code\local\Custom\Order\Helper\Data.php

Create Observer to set these two fields when order is placed

We already written event to trigger a function in Observer.php to set these two fields in config.xml

app\code\local\Custom\Order\Model\Observer.php

Thank you  ~ Kihsor

Share

Leave a Comment

Your email address will not be published. Required fields are marked *