0

Consider the Below Image enter image description here

I want to show an Icon on the Image of each product. I am developing an extension and I want to do this task via that extension, independent of theme. How can I achieve this task. what Blocks I've to extend. Any kind of suggestion and help will be appreciable. Thanks in advance.

Updated:

After adding the suggested code I'm getting the below error enter image description here

0

You can do this with a layout XML file inside of your module. In this layout XML file you can reference product list block and change it's template.

<layout>
<catalog_category_default>
    <reference name="product_list">
        <action method="setTemplate">
            <template>yourmodule/product/list.phtml</template>
        </action>
    </reference>
</catalog_category_default>
<catalog_category_layered>
    <reference name="product_list">
        <action method="setTemplate">
            <template>yourmodule/product/list.phtml</template>
        </action>
    </reference>
</catalog_category_layered>
</layout>

I hope it will help.

4
  • Please check update in question I'm getting errors after including the code – johnyBaba Jan 7 '16 at 11:35
  • Can you share your module's layout xml? – Shyam Jan 7 '16 at 11:44
  • Also enable error reporting on site so that you can debug the issue. You can follow below link to enable error reporting: stackoverflow.com/questions/17143406/… – Shyam Jan 7 '16 at 11:46
  • Also replace template file path with correct once. – Shyam Jan 7 '16 at 11:57

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.