0

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?

1

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>
6
  • But referencing "content" block does not works too. It's a structural block, right?! Nov 24 '14 at 19:30
  • I can't understand you. What exactly are you asking? If you don't change your code and only add this <?php echo $this->getChildHtml('friday.price'); ?> in catalog/product/view.phtml - it should work.
    – michael
    Nov 24 '14 at 19:34
  • Sorry I'll update the question to clarify my doubt (5 min...) Nov 24 '14 at 19:37
  • Please read again, and sorry by my bad english. Nov 24 '14 at 19:49
  • Please read my answer again (I updated it).
    – michael
    Nov 24 '14 at 20:13

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.