Note that there are some explanatory texts on larger screens.

plurals
  1. POMagento: template based on attribute set
    primarykey
    data
    text
    <p>I want to create different product views based on the attribute set the product belongs to: does Magento provide a way to do this? </p> <p><strong>- UPDATE -</strong></p> <p>Following dan.codes suggestion I've added </p> <pre><code>$update-&gt;addHandle('PRODUCT_ATTRIBUTE_SET_ID_'.$product-&gt;getAttributeSetId()); </code></pre> <p>to Mage_Catalog_ProductController (I duplicated ProductController.php and put it in local/Mage/Catalog/controllers/).</p> <p>Then I added this to catalog.xml</p> <pre><code>&lt;PRODUCT_ATTRIBUTE_SET_ID_9&gt; // PRODUCT ID of Book Attribute Set &lt;label&gt;Catalog Product View (Book)&lt;/label&gt; &lt;reference name="product.info"&gt; &lt;block type="catalog/product_view_type_book" name="product.info.book" as="product_type_data" template="catalog/product/view/attribute_set/book.phtml"&gt; &lt;block type="core/text_list" name="product.info.book.extra" as="product_type_data_extra"/&gt; &lt;/block&gt; &lt;/reference&gt; &lt;/PRODUCT_ATTRIBUTE_SET_ID_9&gt; </code></pre> <p>just after</p> <pre><code>&lt;PRODUCT_TYPE_virtual translate="label" module="catalog"&gt; &lt;label&gt;Catalog Product View (Virtual)&lt;/label&gt; &lt;reference name="product.info"&gt; &lt;block type="catalog/product_view_type_virtual" name="product.info.virtual" as="product_type_data" template="catalog/product/view/type/virtual.phtml"&gt; &lt;block type="core/text_list" name="product.info.virtual.extra" as="product_type_data_extra"/&gt; &lt;/block&gt; &lt;/reference&gt; &lt;/PRODUCT_TYPE_virtual&gt; </code></pre> <p>I then created catalog/product/view/attribute_set/book.phtml, but it is not displayed in my product view page.</p> <p><strong>- UPDATE MAGENTO 1.5 -</strong></p> <p>I've noticed that the handler update has moved in the last Magento release. </p> <pre><code>$update-&gt;addHandle('PRODUCT_TYPE_'.$product-&gt;getTypeId()); $update-&gt;addHandle('PRODUCT_'.$product-&gt;getId()); </code></pre> <p>is in Mage/Catalog/Helper/Product/View.php now.<br> I've tested and it still works great!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload