How to display category custom design layout in product view page?

前端 未结 4 1460

Let\'s say I have two categegories, A and B.

I set A to use \'layout_a\' on Catalog -> Catalog Categories -> Click a category -> click custom design tab

I se

4条回答
  •  死守一世寂寞
    2021-01-01 08:53

    I found the answer by myself.

    1. Open product controller located in /app/code/Mage/Catalog/controllers/ProductController.php

    2. add the following code into _initProductLayout method

      $update->addHandle('CATEGORY_'.$product->getCategoryId());

    3. Open catalog layout xml located in /app/design/frontend/default/default/layout/catalog.xml

    4. add

    
        
      
        
    
    

提交回复
热议问题