1
echo $this->getLayout()->createBlock('mpanel/products')
    ->setProductsCount($this->getProductsCount())
    ->setCountPerRow($this->getCountPerRow())
    ->setLoadMore($this->getLoadMore())
    ->setTemplate('mgs/mpanel/products/grid/featured_products.phtml')
    ->toHtml(); 

How I can disable cache for the above block call.

2 Answers 2

1

Try below code

setCacheLifeTime to null and then your block will not be cache

echo $this->getLayout()->createBlock('mpanel/products')
    ->setCacheLifetime('null') //setCacheLifeTime to 0
    ->setProductsCount($this->getProductsCount())
    ->setCountPerRow($this->getCountPerRow())
    ->setLoadMore($this->getLoadMore())
    ->setTemplate('mgs/mpanel/products/grid/featured_products.phtml')
    ->toHtml(); 
2
0

You can use the below code.

<reference name="Your_Block">
    <action method="setCacheLifetime"><s>null</s></action>
</reference>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.