I have followed this tutorial from inchoo.net to get a test module to override a frontend module and it worked. I am now trying to override an adminhtml module, but without much less success.
<config>
....
<global>
<blocks>
<adminhtml>
<rewrite>
<newsletter_queue_grid_renderer_action>Ps_Newsletter_Block_Adminhtml_Newsletter_Queue_Grid_Renderer_Action</newsletter_queue_grid_renderer_action>
</rewrite>
</adminhtml>
<newsletter>
<class>Ps_Newsletter_Block</class>
</newsletter>
</blocks>
</global>
<admin>
<routers>
<adminhtml>
<args>
<module>
<Ps_Newletter before="Mage_Adminhtml">Ps_Newsletter_Adminhtml</Ps_Newletter>
</module>
</args>
</adminhtml>
</routers>
</admin>
....
</config>
-
class Ps_Newsletter_Block_Adminhtml_Newsletter_Queue_Grid_Renderer_Action
extends Mage_Adminhtml_Block_Newsletter_Queue_Grid_Renderer_Action
{
public function render(Varien_Object $row)
{
$actions[] = array(
'url' => $this->getUrl('*/newsletter_queue/send',array('id'=>$row->getId())),
'caption' => Mage::helper('newsletter')->__('Send'),
'popup' => true
);
$this->getColumn()->setActions($actions);
return parent::render($row);
}
}
I have tried to follow a similar technique to the test module, while adding the additional nodes in for it being on the admin side, then tried this tutorial, I guess i've missed something, but what am I doing wrong?
===EDIT===
I have var_dump($actions) and it is displaying expected information, however "send" is not being applied in the action section, below "preview". When I add the above code into the core file it works. So what is happing here that is different? (I thought that extending a file would output the extension value as well as block are called automatically....or so i believe)
<newsletter><class>Ps_Newsletter_Block</class></newsletter>
. This will override all of your newsletter blocks for frontend. You will get a lot of errors or missing sections in frontend.