Orders

How to extend Magento Order Grid?

How to extend Magento Order Grid?

Here is small example which explains how to modify order grid. Main class for order grid is “Mage_Adminhtml_Block_Sales_Order_Grid”, if you want to add some column you have to rewrite this class (block).

Read more

Programmatically create order in Magento

Programmatically create order in Magento

Surprisingly one of the trickiest parts of “under the hood” Magento is how to create order programmatically. At least for me, this was/is the most complex area of Magento development. Reason why it is so difficult is that the order creation process is all but not straightforward. You cannot simply instantiate order model, set some data and call upon the save() method. If you ask me, this is how it should be done.

Read more

How to make order shipment from code

How to make order shipment from code

As most of you know, there is an Order interface in Magento administration from where you can trigger order shipping. However, while developing certain module, you might wish to trigger this event from the code. I hope that this code snippet will help you in this process. In my case I have used this code to make shipment from cron after I got confirmation from fulfillment center

Read more

Extending Order object and hooking on event in Magento

Extending Order object and hooking on event in Magento

One of my previous articles was a Magento Event Hooks. This one will be a practical example on using the event hooks. Although the more proper way would be to call them Observers, bare with me. I’m use to this “hooks”.

Here’s the walk-trough on how to add a new property (attribute) to an object (Mage_Sales_Model_Order object in our case).

Read more