Question

I would like to apply a CMS Block only for products in a specific Category. And I wish to shows it up only at Black Friday's week.

My luck is that I can set the Custom Layout Update field in my Category's admin page. And setting "Apply to All Products" to Yes should works as I'm expecting.

Well I've created my Cms block, but cant show my block in product page. Next the layout code used in "Custom Layout Update" field, on parent Category:

<layout>
    <catalog_product_view>
        <reference name="product.info">
            <block type="cms/block" name="friday.price" before="-">
                <action method="setBlockId"><block_id>friday_banner</block_id></action>
            </block>
        </reference>
    </catalog_product_view>
</layout>

All things works very well when I set another block (not custom cms). Anyone know what is happening?

Was it helpful?

Solution

product.info is catalog/product_view type which as I can see is not a structural block

<block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">

so you have to call it directly where you like to display it in catalog/product/view.phtml by:

<?php echo $this->getChildHtml('friday.price'); ?>

If you are doing this through the admin panel in category custom design tab you have to remove this:

<layout>
    <catalog_product_view>

Enter/fill in only this:

<reference name="product.info">
    <block type="cms/block" name="friday.price">
        <action method="setBlockId"><block_id>friday_banner</block_id></action>
    </block>
</reference>
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top