Ravish
Ravish

Reputation: 2421

Magento different detail page for different product types

I have a problem, I want to display different detail pages for different types of products. Actually I've installed Unirgy Gift Certification plug in and I want a different kind of page to be loaded for this type of product.

I added following code in catalog.xml, but it does not seems to be working

<PRODUCT_TYPE_ugiftcert translate="label" module="catalog">
        <label>Catalog Product View (Gift Certificate)</label>
        <reference name="content">
            <block type="catalog/product_view" name="product.info" template="catalog/product/view-gift.phtml" />
            <block type="catalog/product_view_type_ugiftcert" name="product.info.ugiftcert" as="product_type_data" template="catalog/product/view/type/default.phtml">
                <block type="core/text_list" name="product.info.ugiftcert.extra" as="product_type_data_extra" translate="label">
                    <label>Product Extra Info</label>
                </block>
            </block>
        </reference>
    </PRODUCT_TYPE_ugiftcert>

Can you tell me what I am doing wrong? Is it possible to have different detail pages for different types of product? like different one for configurable/simple product or different detail page based on attribute set.

Upvotes: 0

Views: 2981

Answers (1)

Mike D
Mike D

Reputation: 219

You can update like that if that layout is being called. I wrote a very quick post here a while ago. http://www.sharpdotinc.com/mdost/2010/12/17/magento-layout-handels-and-layout-xml-files/

What you need to do is go into the product controller and in the view action put the following code after the loadLayout() call.

$this->loadLayout();
print_r($this->getLayout()->getUpdate()->getHandles());die();
//     .... OTher COde

This will display all the handles avaliable. If you do not see you handle in here then it will not be loaded.

PRODUCT_TYPE_ugiftcert

Upvotes: 2

Related Questions