Archive for March, 2010

Magento – get at $_POST inside module Observer.php

March 18, 2010 1 comment

Interesting dilemma, the module observer is getting triggered off a _before_save event, so the $observer passes in the save event that is internal to magento, not off a controller action. So how to get at the $_REQUEST variables? Well… the right way, I mean, of course we could go over Magento’s head to the global vars. But let’s keep things nice and neat.

To get at the request variable use this:

Mage::app()->getFrontController()->getRequest()->getParam('default_shipping', false);

Needless to say, I’ve been playing around, customizing the address book feature of magento.

Categories: magento Tags: ,