Question

I am trying to make module that switches diffrent .phtml of productview depend on attributeset name. I dont know witch file is responsible for rendering productview.

Pas de solution correcte

Autres conseils

It is usually Magento Block that render template. In your case productivew is rendered by

Mage_Catalog_Block_Product_View.

You can easily figure this out by enabling template_hints and template_hints_blocks. To enable these to option follow steps below:

  1. Go go Admin
  2. System > Configuration
  3. In left column, Select Developer under Advance.
  4. Change Current Configuration Scope to website level (template_hints and template_hints_blocks is applicable at website level only)
  5. Make yes to Template Path Hints and Add Block Names to Hints under Debug group.

you can rewrite this class:

Mage_Catalog_Block_Product_View

and then you can add your own logic to it to switch to another template, not the standard

catalog/product/view.phtml
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top