Magento Forum

   
How to override getSkinUrl in Mage_Core_Block_Abstract using a custom module
 
genghis
Jr. Member
 
Total Posts:  15
Joined:  2008-09-16
 

Hi Forum,

I have overiden the getSkinUrl method in Mage_Core_Block_Abstract class. Things work OK.
But when I have used my custom module and extends the Mage_Core_Block_Abstract as MyCompany_Core_Block_Abstract in my custom module. It does not simply picks up.

Below is the config.xml in my custom module.

<?xml version="1.0"?>
<config>
<modules>
<MyCompany_Core>
<version>0.1.0</version>
</MyCompany_Core>
</modules>

<global>
<blocks>
<core>
<rewrite>
<abstract>MyCompany_Core_Block_Abstract</abstract>
</rewrite>
</core>
</blocks>
</global>
</config>

I have the Abstract class under MyCompany->Core->Block.

I have defined the module under etc/modules:

<config>
<modules>
<MyCompany_Core>
<active>true</active>
<codePool>local</codePool>
<depends>
<MyCompany_Core />
</depends>
<version>0.1.0</version>
</MyCompany_Core>
</modules>
</config>

So what I am missing? By the way, How can I debug and see the values of rewritten classes in magento? That way I could know if the Mycompany_Core_Block_Abstract overwrites Mage_Core_Block_Abstract !!

Thanks and regards;

 
Magento Community Magento Community
Magento Community
Magento Community
 
nico5
Sr. Member
 
Avatar
Total Posts:  214
Joined:  2008-02-19
France
 

Try to delete these 3 lines :

<depends>
<MyCompany_Core />
</depends>

 
Magento Community Magento Community
Magento Community
Magento Community
 
genghis
Jr. Member
 
Total Posts:  15
Joined:  2008-09-16
 

Thanks for the answer…
Nop. It did not work.
It seems that one can not rewrite an abstract class like this.
This is where Magento modularity fails ??!!!

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top