Magento Customization : How to Use Observer to Modify Shipping Block on One Page Checkout in Magento

1) Define Observer in Module Configuration xml:
ModuleName/etc/config.xml
Sample code.:
<frontend>
<events>
<checkout_controller_onepage_save_shipping_method>
<observers>
<modulename_observer>
<type>singleton</type>
<class>modulename/observer</class>
<method>checkout_controller_onepage_save_shipping_method</method>
</modulename_observer>
</observers>
</checkout_controller_onepage_save_shipping_method>
</events>
</frontend>

2) Define Observer Inside Your Module:
ModuleName/Model/Observer.php
sample code.:
class NameSpace_ModuleName_Model_Observer
{
//Declare observer function
public function checkout_controller_onepage_save_shipping_method($observer)
{
//Set of code whatever you want to do
}
}


By | 2015-01-14T10:56:16+00:00 March 27th, 2012|Checkout, Magento, Oscp-Blog, Shipping|Comments Off on Magento Customization : How to Use Observer to Modify Shipping Block on One Page Checkout in Magento