Im trying to add a button to the order view page on the admin, next on the credit memo for example or something similiar, but is not showing the button, and i have no idea how to test it to find the problem.
Here is my code, maybe someone can notice any problem.
config.xml
<config> <modules> <Cloud_Magni> <version>0.1.0</version> </Cloud_Magni> </modules> <global> <models> <magni> <class>Cloud_Magni_Model</class> </magni> </models> <resources> <invoicedocs_setup> <setup> <module>Cloud_Magni</module> <class>Cloud_Magni_Model_Resource_Mysql4_Setup</class> </setup> <connection> <use>core_setup</use> </connection> </invoicedocs_setup> <invoicedocs_write> <connection> <use>core_write</use> </connection> </invoicedocs_write> <invoicedocs_read> <connection> <use>core_read</use> </connection> </invoicedocs_read> </resources> <blocks> <magnifi> <class>Cloud_Magni_Block</class> </magnifi> <adminhtml> <rewrite> <sales_order_view>Cloud_Magni_Block_Adminhtml_Sales_Order_View</sales_order_view> </rewrite> </adminhtml> </blocks> <helpers> <magnifi> <class>Cloud_Magni_Helper</class> </magnifi> </helpers> <events> <sales_order_invoice_pay> <observers> <magni> <type>model</type> <class>magni/observer</class> <method>createInvoice</method> </magni> </observers> </sales_order_invoice_pay> <sales_order_creditmemo_save_after> <observers> <magni> <type>model</type> <class>magni/observer</class> <method>createCredit</method> </magni> </observers> </sales_order_creditmemo_save_after> </events> </global> </config>
View.php:
class Cloud_Magni_Block_Adminhtml_Sales_Order_View extends Mage_Adminhtml_Block_Sales_Order_View { public function __construct() { parent::__construct(); $ this->_addButton('magni', array( $ message = "are you sure?", 'label' => Mage::helper('Sales')->__('Segunda Fatura'), 'onclick' => "confirmSetLocation('{$ message}','{$ this->getUrl('Cloud_Magni')}')" )); } }