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>
2
  • Do you want to rewrite of same class?
    – Priyank
    Jul 9, 2018 at 10:55
  • not the same class two different one, the answer bellow is exactly what i needed to know Jul 9, 2018 at 11:54

1 Answer 1

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>
2
  • it worked :D i read on stackoverflow some said it's not possible. Jul 9, 2018 at 11:53
  • Yes it works ;)
    – PЯINCƎ
    Jul 9, 2018 at 12:12

Your Answer

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

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