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.

Murtuza Zabuawala
14.8k10 gold badges47 silver badges76 bronze badges
asked Jan 31, 2018 at 8:13

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(); 
answered Jan 31, 2018 at 8:45
2
  • It's not working. Commented Jan 31, 2018 at 9:18
  • 1
    @KarnaSaradar try with null Commented Jan 31, 2018 at 9:40
0

You can use the below code.

<reference name="Your_Block">
 <action method="setCacheLifetime"><s>null</s></action>
</reference>
answered Jan 31, 2018 at 8:39

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.