I am trying to remove a parameter under certain conditions when it is passed to my controller. The var_dump of the request contains all the parameters. The parameter I want to remove is called super_attribute. Let's take a look at that var_dump shall we?
[product] => 10
[form_key] => XXYY
[related_product] =>
[super_attribute] => Array
(
[220] => 1141
)
I am able to set the product parameter to another figure using:
$this->getRequest()->setParam('product', $product->getId());
However, I would like to know a way to altogether remove the super attribute or null it's array, heck, or even just change the values contained within! For starters:
$this->getRequest()->setparam('super_attribute', null);
nor
$params = $this->getRequest()->getParams();
unset($params['super_attribute']);
hold any water.
$this->getRequest()->setPost('super_attribute', null)
. If that don't work take a look atsetRequest(Mage_Core_Controller_Request_Http $request)