In this post, I will show how to display one product in magento store inside a CMS page with CMS block widget.Magento ‘ve already supported a widget “product_widget_link” and we only need to use and customize the template. Here is the way we display a product in magento CMS page.


{{widget type="catalog/product_widget_link"
anchor_text="[Optional: CUSTOM LINK TEXT]"

Then customize the template file in app/design/frontend/base/default/template/catalog/product/widget/link/link_block.phtml.

You can do the customisation something like this:


$_product = $this->getProduct();
$_image = '';
$_price = '$' . money_format('%n', $_product->getFinalPrice());

if ($_product) {
    $_image = Mage::helper('catalog/image')->init($_product, 'thumbnail')
<div class="item">
    <a <?php echo $this->getLinkAttributes() ?>>
        <img src="<?php echo $_image; ?>" alt="<?php echo $this->htmlEscape($this->getAnchorText()); ?>" style="border:0" />
        <?php echo nl2br($this->htmlEscape($this->getAnchorText())); ?><br />
        <b><?php echo $_price; ?></b>

One thought on “CMS block widget for Product in Magento

Comments are closed.