Magento – Magento disable cache for price block

blockscacheee-1.14.0.1enterprise-1.14layout

In my project we are using Magento Enterprise Edition 1.14.1. The prices in store are changed dynamically direct from Database. So the problem is Magento cache every thing (full page cache) so the changes are not affected in front end. So we are decided disable the cache for that particular block. I know it can done in layout files. I checked in layout catalog.xml and I found it the block

<block type="catalog/product_price_template" name="catalog_product_price_template" />

So here I don't know how to disable it. I have tried set fife time of cache to null in app/etc/local.xml ,

 <layout>
    <default>
         <reference name="catalog_product_price_template">
            <action method="setCacheLifetime" />
        </reference>
    </default>
    </layout>

and tried in layout/catalog.xml

<block type="catalog/product_price_template" name="catalog_product_price_template" >
         <action method="setCacheLifetime" />
        </block>

But no luck.

And I have found some other price blocks in layout/bundle.xml file. We are using bundle product as well. So we have to disable this cache also ? Any help would be appreciated. Thanks.

Best Answer

Most likely it is the FPC that is sticky and not the block.

Pricing should be hole punched by default for the FPC if you are using a default theme.

I would recommend reviewing your theme/template in more detail. To help facilitate this AOE_TemplateHints is great at identifying blocks that are being cached or not.

Try this instead, NOTE, the </s> will pass a null value, as 0 will mean cache forever.

<block type="catalog/product_price_template" name="catalog_product_price_template" >
         <action method="setCacheLifetime"><s>null</s></action>
        </block>

References: