0

I want to add a static block on my website Category page. This is the link of that page.

https://flowerportal.in/online-flower-delivery/all-cities/bangalore

I have just created some banners for Bangalore product page but I don't know how to add a static block here. If you guys can help me regarding this then I will be really happy.

2
  • This is more of a programming question than a sysadmin question. Ideally, it'll be moved to a place where it's more likely to get good answers. You could expedite that process by clicking the "flag" option on the post and asking for a migration to Stack Overflow.
    – TRiG
    Commented Aug 9, 2018 at 13:22
  • or to Magento, if such questions are on topic there. In the current state it would be off topic on SO as well.
    – Gerald Schneider
    Commented Aug 9, 2018 at 13:39

2 Answers 2

0

You need to add the below code to your catalog/product/view.phtml according to your requirement and change the block_identifier with your identifier which includes the banners:

<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('block_identifier')->toHtml(); ?>
0

Since the product page is built with the help of PHTML and XML files, you can call a static block from the layout XML file or directly from the phtml file.

Since you want to call the static block for the particular condition, I would recommend calling the block from the phtml file.

To do so, open the phtml file and call

<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('block_identifier')->toHtml(); ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.