I have to add a panel into the frontend's product view page. Originally, I will find the full action name of the product page, which is catalog_product_view
in this case, and add a handler which reference to the panel's block later. However, something really strange is happening, as Magento only look for configurable products to add the panel:
Not with the simple products:
Here's the code for that:
$fullActionName = $observer->getEvent()->getFullActionName();
$layout = $observer->getEvent()->getLayout();
$option_wrapper = $layout->getBlock('product.info.options.wrapper');
$handler = '';
if ( $fullActionName == 'catalog_product_view') {
$handler = 'catalog_product_view_handler';
}
if ($handler) $layout->getUpdate()->addHandle($handler);
I'm pretty sure my solution is right. How could this happen?