I am trying to display random testimonials, but due to magento cache the random is not working, i have to flush the cache each time to see the testimonials change, my code
public function getTestimonialsLast(){
$collection = Mage::getModel('testimonial/testimonial')->getCollection();
$collection->getSelect()->order(new Zend_Db_Expr('RAND()'));
$collection->addFieldToFilter('status',1);
$collection->setPageSize(5);
return $collection;
}
我怎樣才能使它工作,我怎樣才能使它隨時刷新收集是隨機的。 任何幫助,不勝感激。 謝謝你在前進,越來越隨機推薦在magento由於緩存不工作
在哪座你使用這種方法嗎? –