0

Can we rewrite multiple blocks of a core extension like catalog ? like this :

<blocks>
    <catalog>
        <rewrite>
            <class_name_here>YourNamespace_YourModule_Block_Your_New_Class_Here</class_name_here>
            <2nd_class_name_here>YourNamespace_YourModule_Block_Your_2nd_Class_Here</2nd_class_name_here>
        </rewrite>
    </catalog>
</blocks>
  • Do you want to rewrite of same class? – Priyank Jul 9 '18 at 10:55
  • not the same class two different one, the answer bellow is exactly what i needed to know – Subhan Sunny Jul 9 '18 at 11:54
1

Yes it is possible, assuming that you want to rewrite :

  • Catalog/Block/Navigation.php and

  • Catalog/Block/Product.php

In your config.xml module :

<config>
    <blocks>
        <catalog>
            <rewrite>
                <navigation>Module_Name_Block_Navigation</navigation>
                <product>Module_Name_Block_Product</product>
            </rewrite>
        </catalog>
    </blocks>
</config>
  • it worked :D i read on stackoverflow some said it's not possible. – Subhan Sunny Jul 9 '18 at 11:53
  • Yes it works ;) – PЯINCƏ Jul 9 '18 at 12:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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