I am developing a extension and I've to add an icon on images of products having specific tag "app_product". Yes, I know that we can do this task by modifying view.phtml and list.phtml but I think this approach is theme dependent. What I want; when I enable my extension the icon will be appeared and when I disable my extension, the icon must be disappeared. And I've to this task independent of theme. Please help me to figure out this issue.

And Thanks in advance.

1 Answer 1


There is a solution for ProductDetailPage.

  1. You can just create your own block in scope of your module;

  2. Add layout update that will add new block before/after product.info.media block (base/default/layout/catalog.xml:195 - "catalog_product_view" handler) . View needed icon via this block.

  3. Process correct icon location via js or css (do not forget to add js and css files into layout update).

The same solution can be implemented on category page, but if you do not want to override product/list.phtml you should add new block via layout update (as mentioned before) that will add icons for all product images on category page and after it process correct icons location via js (via icon name or icon wrapper id).

For my opinion it would be better if you will just override needed templates and add instruction for your module that will help developer to update his current theme with your changes.


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.