Im using Magento EE version 1.12 with Full page cache enabled
a) my product detail page is cached b) as a result my shopping cart in this page doesn't show dynamic item count c) so i am not able to show valid cart item count in my product detail page
steps i followed
1) I created a block and called from header.phtml 2) trying to make that topcart.phtml block not to be cached
As im a newbie in magento , i got some links for cache hole punching
I followed below links but no success
my file structure
app- code - local - Enterprise - PageCache ->etc - cache.xml
and PageCache - model -container - TopCart.php
code as shown below
i created files cache.xml and cart.php container file
<page_html_topcart>
<block>page/html_topcart</block>
<name>topcart</name>
<placeholder>PAGE_HTML_HEADER_CART</placeholder>
<container>Enterprise_PageCache_Model_Container_TopCart</container>
<cache_lifetime>36400</cache_lifetime>
</page_html_topcart>
this is my topcart.php container file looks like
protected function _getIdentifier()
{
$cacheId = $this->_getCookieValue(Enterprise_PageCache_Model_Cookie::COOKIE_CUSTOMER, '')
. '_'
. $this->_getCookieValue(Enterprise_PageCache_Model_Cookie::COOKIE_CUSTOMER_LOGGED_IN, '');
return $cacheId;
}
protected function _getCacheId()
{
return 'CONTAINER_TOPCART_' . md5($this->_placeholder->getAttribute('cache_id') . $this->_getIdentifier());
}
protected function _renderBlock()
{
$block = $this->_getPlaceHolderBlock(); //('page/html_header_cart');
Mage::dispatchEvent('render_block', array('block' => $block, 'placeholder' => $this->_placeholder));
return $block->toHtml();
}
kindly help me out with useful links and step