Programmatically remove block from layout

后端 未结 3 745
逝去的感伤
逝去的感伤 2021-01-15 13:55

I want to remove the product_options_wrapper block from the product view page according to the logedin user via frontend router controller.

I know that I can program

3条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-15 14:28

    Inorder to remove a block using its parent block use the code below

    $this->getLayout()->getBlock('product.info')->unsetChild('product_options_wrapper');
    

提交回复
热议问题