4

I'm trying to extend the class of a third party Magento extension.

My module xml:

within config>modules> tags

<EDPA_MegaNavigation>

        <active>true</active>

        <codePool>local</codePool>

        <depends>
            <Infortis_UltraMegamenu />
        </depends>

    </EDPA_MegaNavigation>

My Config xml:

within config>global>blocks> tags

 <ultramegamenu>

       <rewrite>

           <Infortis_UltraMegamenu_Block_Navigation>EDPA_MegaNavigation_Block_Navigation</Infortis_UltraMegamenu_Block_Navigation>

       </rewrite>

   </ultramegamenu>

My extended class (Navigation.php) has

class EDPA_MegaNavigation_Block_Navigation extends Infortis_UltraMegamenu_Block_Navigation
{
########
}

Within system>configuration>advanced EDPA_MegaNavigation is listed and shows as enabled.

My target navigation.php within Infortis>UltraMegamenu>Block is not being rewritten.

Any help/guidance much appreciated.

3
  • put Infortis>UltraMegamenu >etc>config.xml for works
    – Amit Bera
    Jun 10, 2014 at 16:47
  • in which codepool your ultramegamenu module is located? in local or community? Jun 10, 2014 at 16:57
  • local codepool - but please check Amit Bera's answer as this got my extension working.
    – strawbicus
    Jun 11, 2014 at 13:39

2 Answers 2

4

Here the issue in if Infortis_UltraMegamenu module block tag is ultramegamenu then

<ultramegamenu>

       <rewrite>

           <navigation>EDPA_MegaNavigation_Block_Navigation</navigation>

       </rewrite>

   </ultramegamenu>
1
  • Perfect! I changed my <Infortis_UltraMegamenu_Block_Navigation> tag to <navigation>, refreshed the browser, worked. Thank you Amit Bera!
    – strawbicus
    Jun 11, 2014 at 8:54
0

Your <rewrite> doesn't look to be set up properly, it's supposed to reference another config node and not a direct class name. Check the UltraMegamenu's config.xml to get the node from it.

e.g. If UltraMegamenu is set up like:

<blocks>
    <ultramegamenu>
        <class>Infortis_UltraMegamenu_Block_Navigation</class>
    </ultramegamenu>
</blocks>

Then your rewrite child node would be "ultramegamenu" instead of the class name.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.