tags:

views:

17

answers:

1

Hi,

I want to extend a community module's Unirgy_Dropship_Block_Adminhtml_Shipment_View class which extends Mage_Adminhtml_Block_Sales_Order_Shipment_View to My_Bshipment_Block_Adminhtml_Shipment_View below is my xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
 <modules>
  <My_Bshipment>
   <version>0.1.0</version>
  </My_Bshipment>
 </modules>
 <global>
  <models>
   <bshipment>
    <class>My_Bshipment_Model</class>
   </bshipment>
  </models>
        <resources>       
            <bshipment_setup>
                <setup>
                    <module>My_Bshipment</module>
                </setup>
                <connection>
                    <use>core_setup</use>
                </connection>
            </bshipment_setup>
            <bshipment_write>
                <connection>
                    <use>core_write</use>
                </connection>
            </bshipment_write>
            <bshipment_read>
                <connection>
                    <use>core_read</use>
                </connection>
            </bshipment_read>
        </resources>
  <blocks>
   <udropship>
    <rewrite>
     <adminhtml_shipment_view>My_Bshipment_Block_Adminhtml_Shipment_View</adminhtml_shipment_view>
    </rewrite>
   </udropship>
  </blocks>
 </global>
</config>

also my module config file looks like

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
      <My_Bshipment>
  <active>true</active>
  <codePool>local</codePool>
  <depends>
   <Unirgy_Dropship/>
   <Mage_Adminhtml/>
  </depends>
      </My_Bshipment>
    </modules>
</config>

Please point my mistake, its not calling my class

Regards, Saurabh

+1  A: 

Taking a quick look, the above config will override a block with the grouped class name of

udropship/adminhtml_shipment_view

<blocks>
    <udropship>
        <rewrite>
            <adminhtml_shipment_view>My_Bshipment_Block_Adminhtml_Shipment_View</adminhtml_shipment_view>
        </rewrite>
    </udropship>
</blocks>

However, Magento never creates a block with this grouped class name. It creates a class with the grouped class name

adminhtml/sales_order_shipment_view

Have your config rewrite the above groupd class name, and then define your class to extend

Unirgy_Dropship_Block_Adminhtml_Shipment_View 
Alan Storm