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 7599379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:38:48+00:00 2026-05-30T22:38:48+00:00

In theory how should I code this or implement a solution to my problem?

  • 0

In theory how should I code this or implement a solution to my problem?

Let say I have a 3 various design for product page.

  1. Special Products / attributes: [Name:, Blurb:, Price:, Product Image:, Description:, ]
  2. Regular Products / attributes: [Name:, Product Image:, Description:, ]
  3. Other Products / attributes: [Name:, Product Image:, Description:, Links:, ]

I think they all just share one template (app/design/frontend/default/skinName/template/product/view.phtml) but I want to do 3 variation for each of them. Each of product variation also have different attributes. I’m using Magento 1.6.

Please advice where do I start.

Thank You!

  • 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-30T22:38:50+00:00Added an answer on May 30, 2026 at 10:38 pm

    Option 1: layout XML by product type

    Are the three different product variations separate product types by chance (e.g. configurable, simple and downloadable)?
    If so, you could set a different template using a layout update declaration in your themes layout/local.xml file:

    <layout>
        <PRODUCT_TYPE_configurable>
            <reference name="product.info">
                <action method="setTemplate">
                    <template>my/catalog/product/view_configurable.phtml</template>
                </action>
            </reference>
        </PRODUCT_TYPE_configurable>
        <PRODUCT_TYPE_simple>
            <reference name="product.info">
                <action method="setTemplate">
                    <template>my/catalog/product/view_simple.phtml</template>
                </action>
            </reference>
        </PRODUCT_TYPE_simple>
        <!-- etc... -->
    </layout>
    

    Option 2: custom layout updates

    You could also use the custom layout updates property of products to specify the template to use via layout XML. In that case simply omit the layout handle from the code above.

    Option 3: event observer

    If your product variations can’t be distinguished by product type, and you don’t want to add custom layout XML to every product, you will indeed have to create a product attribute that specifies which type the product belongs to. Make it invisible on the frontend if you don’t want customers to see it.

    Then, create an event observer for the controller_action_layout_render_before_catalog_product_view event.
    In the observer method, get the product.info block and set the template you want.

    public function controllerActionLayoutRenderBeforeCatalogProductView(Varien_Event_Observer $observer)
    {
        $block = Mage::app()->getLayout()->getBlock('product.info');
        switch ($observer->getProduct()->getYourAttribute())
        {
            case 'Special Products':
                $block->setTemplate('my/catalog/product/view_special.phtml');
                break;
            case 'Regular Products':
                $block->setTemplate('my/catalog/product/view_regular.phtml');
                break;
            case 'Other Products':
                $block->setTemplate('my/catalog/product/view_other.phtml');
                break;
        }
    }
    

    Option 4: block rewrite

    Another option – even though more conflict prone – would be to rewrite the catalog/product_view block, overload the _beforeToHtml() method and specify the template to use there. I’ll won’t go into more detail here because I think the previous options are better.

    So, depending on the type of approach you take, there are many possibilities (these aren’t all).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In theory, this code should set the new lock status to the users and
Consider the following code, in theory the click event should bind to each element
I have defined a menu template which, in theory, should use the backgroundcolor of
Currently I have this code var App = Ember.Application.create(); App.user = Ember.Object.create({ people: customers
So, I have basic frame with GroupLayout and 3 component. It in theory should
Please ignore code readability in this question. In terms of performance, should the following
Theoretically, the end user should never see internal errors. But in practice, theory and
In theory in layered architecture you can have multiple modules on the same layer.
I have a bit of code with the following logic: //pseudo-code foreach (element in
So this question is regarding the .Net IAsyncResult design pattern and the necessity of

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.