php - Create a Custom Block from Observer in Magento -


i need write observer show products block @ bottom of product details page.

so, have written capturing event 'catalog_product_load_after'. need create custom block can called through getchildhtml() in product details page.

any appreciated.

it sounds don't need observer @ if event you're waiting fire product details / view page load? might wrong please provide context , gist of want happen.

i assume want add static block bottom of product's view? if so, no need add observer.

to use getchildhtml('block_name'), need define in theme's catalog.xml. add following within <reference name="content"> of layout handle catalog_product_view:

<block type="cms/block" name="block_name">     <action method="setblockid"><block_id>block_identifier</block_id></action> </block> 

then, in product view.phtml, can add:

<?php echo $this->getchildhtml('block_name'); ?> 

in place want appear.


Comments

Popular posts from this blog

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -