1

I've been trying to add a static block to individual product pages, below the add to cart button, using "Product > Design > Custom Layout Update".

I've tried various versions of the code below, but without any success.

<reference name="content">
<block type="cms/block" name="wetsuits" before="product.info.addtocart">
    <action method="setBlockId"><block_id>wetsuits</block_id></action>
</block>  
</reference>

I'm using 1.9.1.0, any help is greatly appreciated.

  • Do you see this this block anywhere on product page? If this CMS block exists, you should see it, but not 'below add to cart' button. – SeStro Dec 3 '15 at 20:39
  • Yes, it does show on the page. But always above or below the "content" area. I did, at one time, have it working for placing special messages for certain brands, but that may have been on 1.7? However, I can't remember the old code I used then to make it work and the magento forum that used to exist is now gone, so I can't find those old posts. – dawhoo Dec 3 '15 at 21:01
2

You should change reference name to 'product.info':

<reference name="product.info">
    <block type="cms/block" name="wetsuits" before="product.info.addtocart">
        <action method="setBlockId"><block_id>wetsuits</block_id></action>
    </block>  
</reference>

And then add to catalog/product/view.phtml file in your template this code:

<?php echo $this->getChildHtml('wetsuits'); ?>
  • Excellent, this works very well and doesn't show unless the item has the Layout Update code - perfect! – dawhoo Dec 5 '15 at 20:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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