سؤال

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>
هل كانت مفيدة؟

المحلول

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>
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى magento.stackexchange
scroll top