我为 catalog/product_price 块尝试了这个,但我得到:
致命错误:在第 176 行的 /var/www/html/app/code/core/Mage/Catalog/Block/Product/Price.php 中的非对象上调用成员函数 getCacheIdTags()
有任何想法吗?
<?xml version="1.0" encoding="UTF-8"?>
<config>
<placeholders>
<catalog_product_price>
<block>catalog/product_price</block>
<placeholder>TEST_CACHE</placeholder>
<container>Test_PageCache_Model_Container_Cache</container>
<cache_lifetime>0</cache_lifetime>
</catalog_product_price>
</placeholders>
</config>
还有我的容器
class Test_PageCache_Model_Container_Cache extends Enterprise_PageCache_Model_Container_Abstract{
protected function _getCacheId()
{
return 'TEST_CACHE' . md5($this->_placeholder->getAttribute('cache_id'));
}
protected function _renderBlock()
{
$blockClass = $this->_placeholder->getAttribute('block');
$template = $this->_placeholder->getAttribute('template');
$block = new $blockClass;
$block->setTemplate($template);
return $block->toHtml();
}
protected function _saveCache($data, $id, $tags = array(), $lifetime = null) { return false; }}
我启用了 FPC 来检查这一点,但是当我刷新块所在的页面时,我收到了后面提到的错误。
谢谢