Magento 1.8 – Create Observer Before Saving Billing & Shipping Address

checkoutmagento-1.8php-5.4

how to show custom error message if billing/shipping(section) address is not valid .

or

How to create an observer before save billing & shipping address on checkout page in magento?

So for that I will fire an event.

Thanks.

Best Answer

You can use the standard controller action events: 'controller_action_predispatch_' . $this->getFullActionName()

In the case of the saveBilling action the event is controller_action_predispatch_checkout_onepage_saveBilling

and for saveShipping is controller_action_predispatch_checkout_onepage_saveShiping.

You can access the values sent to that action by

Mage::app()->getRequest()->getPost();
Related Topic