- Web templates
- E-commerce Templates
- Loaded Commerce
- E-Commerce Comparison
- E-commerce Comparison: Payment and Shipping methods
- E-commerce templates compatibility table
- CMS & Blog Templates
- CMS Comparison
- CMS templates versions compatibility
- Facebook Templates
- Website Builders
Magento. How to add static block to individual products pages
February 25, 2016
In this tutorial we will show how to add a static block to the specific product detail page in Magento.
Log into the Magento Admin panel and navigate to CMS -> Static Blocks section.
Click on Add New Block.
Specify your Block Title and Identifier. Remember the Identifier as we will need it later.
Add your content in the Content Field:
Save the block when you are done.
Hover over your newly created block to find out the Block ID. Remember the Block ID value as we will need it later:
Go to Catalog -> Manage Products and select your product to edit.
Go to the Design tab.
In the Custom Layout Update field input the following code:
<reference name="product.info"><block type="cms/block" name="product_info" ><action method="setBlockId"><block_id>22</block_id></action></block></reference>
Where name=”product_info” is your Identifier and block_id 22 is your Block ID value:
Save this product.
Connect to your server using any FileManager, such as FileZilla.
Open app\design\frontend\tm_themes\themeXXX\template\catalog\product\view.phtml file.
Add the following code into the place where you wish to display the Static Block:
<?php echo $this->getChildHtml('product_info')?>
Note: change ‘product_info’ to your own Identifier:
Save this file.
Go to your site and reload the page to see the changes:
Feel free to check the detailed video tutorial below: