update layout programmatically in magento event observer

后端 未结 5 971
陌清茗
陌清茗 2020-12-23 23:43

I am trying to change the template(view.phtml) of a block (product.info) for product detail page, to do this, I am observing an event (controller_action_l

5条回答
  •  伪装坚强ぢ
    2020-12-24 00:12

    Why on earth are you doing it this way?

    It would be better to use either the local.xml layout file or a layout file declared for a custom module to do this:

    
    
        
            
                
                    customelayout/product/view.phtml
                
            
        
    
    

    FYI when a block name is ed, no block with that name will be instantiated for any rendering scope which includes that remove directive.

提交回复
热议问题