Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Different view.phtml files for group & bundle product types in magento

Tags:

magento

Im trying to make some design changes to group, bundle and configurable product types on the product page itself. So far Ive been doing this with assigning different templates to products, but at this moment this is not an option unfortunately...

I have already designed the custom_view.phtml and custom_view2.phtml for bundle and group type products, but I dont know how to make magento to render those phtml files according to those product types...

can anyone help me with this issue please?

Thank you...

like image 733
Jonathan Bell Avatar asked Nov 09 '11 20:11

Jonathan Bell


2 Answers

I know this topic is somewhat old, but I found myself needing an answer for this question also, and this is what worked for me:

in bundle.xml, find

<PRODUCT_TYPE_bundle translate="label" module="bundle">

and add the following reference:

    <reference name="product.info">
        <action method='setTemplate'><template>path/to/your/template/view.phtml</template></action>
    </reference>

Hope this helps :)

like image 130
Gyula Kovats Avatar answered Oct 29 '22 17:10

Gyula Kovats


Look in /app/design/frontend/default/default/layout/catalog.xml

There are lines like the following:

<PRODUCT_TYPE_grouped translate="label" module="catalog>
  ...
</PRODUCT_TYPE_grouped>

In that XML you can add layout xml to override the template used. You should copy this layout xml file into your own skin and make the changes there. I am guessing you want:

<reference name="content">
  <block type="catalog/product_view" name="product.info" template="path/to/your/custom_view2.phtml">
</reference>
like image 36
Tim Reynolds Avatar answered Oct 29 '22 18:10

Tim Reynolds