Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3753086
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T09:20:17+00:00 2026-05-19T09:20:17+00:00

I want to create different product views based on the attribute set the product

  • 0

I want to create different product views based on the attribute set the product belongs to:
does Magento provide a way to do this?

– UPDATE –

Following dan.codes suggestion I’ve added

$update->addHandle('PRODUCT_ATTRIBUTE_SET_ID_'.$product->getAttributeSetId());

to Mage_Catalog_ProductController (I duplicated ProductController.php and put it in local/Mage/Catalog/controllers/).

Then I added this to catalog.xml

<PRODUCT_ATTRIBUTE_SET_ID_9> // PRODUCT ID of Book Attribute Set
    <label>Catalog Product View (Book)</label>
    <reference name="product.info">
        <block type="catalog/product_view_type_book" name="product.info.book" as="product_type_data" template="catalog/product/view/attribute_set/book.phtml">
            <block type="core/text_list" name="product.info.book.extra" as="product_type_data_extra"/>
        </block>
    </reference>
</PRODUCT_ATTRIBUTE_SET_ID_9>

just after

<PRODUCT_TYPE_virtual translate="label" module="catalog">
    <label>Catalog Product View (Virtual)</label>
    <reference name="product.info">
        <block type="catalog/product_view_type_virtual" name="product.info.virtual" as="product_type_data" template="catalog/product/view/type/virtual.phtml">
            <block type="core/text_list" name="product.info.virtual.extra" as="product_type_data_extra"/>
        </block>
    </reference>
</PRODUCT_TYPE_virtual>

I then created catalog/product/view/attribute_set/book.phtml, but it is not displayed in my product view page.

– UPDATE MAGENTO 1.5 –

I’ve noticed that the handler update has moved in the last Magento release.

$update->addHandle('PRODUCT_TYPE_'.$product->getTypeId());
$update->addHandle('PRODUCT_'.$product->getId());

is in Mage/Catalog/Helper/Product/View.php now.
I’ve tested and it still works great!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T09:20:17+00:00Added an answer on May 19, 2026 at 9:20 am

    No it doesn’t but you can extend the functionality to do so by extending the _initProductLayout method in Mage_Catalog_ProductController under where the code is this

        $update = $this->getLayout()->getUpdate();
        $update->addHandle('default');
        $this->addActionLayoutHandles();
    
        $update->addHandle('PRODUCT_TYPE_'.$product->getTypeId());
        $update->addHandle('PRODUCT_'.$product->getId());
    

    You could add

    $update->addHandle('PRODUCT_ATTRIBUTE_SET_ID_'.$product->getAttributeSetId());
    

    Then in your layout.xml you could have

    <PRODUCT_ATTRIBUTE_SET_ID_IDHERE>
      <reference name="root">
                <action method="setTemplate"><template>template/path/here.html</template></action>
            </reference>
    </PRODUCT_ATTRIBUTE_SET_ID_IDHERE>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to model e-commerce product attributes that can be changed in run-time. So
My (rails 3) application use collection and product as models. collection has_many products and
First of all, I want to describe my project architecture: My project uses jqGrid.
It is possible to choose different templates when I am creating a new node?
I've a vector of vectors say vector<vector<int>> of different sizes as follows: vector<vector<int>> items
I have a list of products I want to generate xml for currently all
In a MVC3-application with Ninject.MVC 2.2.0.3 ( after merge ), instead of injecting repostories
I have a function which loads some content when executed... IE... function load_product(product_id) {
I've got the following requirement that works well in the OO space but I
In Haskell there are two functions that allow one to perform an operation on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.