0

We are selling different kind of products like Tshirts , Mobiles , Toys , Books , shoes..etc....

for each types there will be different type of product view pages.

so we have 2 options

1) Create different Theme to write code for different kind of products

2) Same theme with different code for different attribute sets, like below :

if($_product->getAttributeSetId()==20)
{  // code here // }

If we write too much code in view.phtml, is it going to effect on performance of product view page ?

which option is better for performance ?

1

The performance shouldn't be affected, but the code might become hard to read after a while.

I would create a new Product View block for the part you wish, and dynamically change the template according to the attribute set.

protected function _toHtml()
{
    $this->setTemplate('product/view/custom/....phtml');
    parent::_toHtml()
}
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.