|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Jasinka Smarty n00b
Joined: 14 Oct 2015 Posts: 1
|
Posted: Wed Oct 14, 2015 1:03 pm Post subject: How to exclude smarty cache from caching module? |
|
|
Hello,
I wanna ask how working smarty cache? I wanna exclude one module in my prestashop.It's call - "blockbestsellers".
What i need is don't create cache - /cache/smarty/cache/blockbestsellers_col
Code what i have and i think do cache.
blockbestsellers.php
Code: |
public function hookRightColumn($params)
{
if (!$this->isCached('blockbestsellers.tpl', $this->getCacheId('blockbestsellers-col')))
{
if (!isset(BlockBestSellers::$cache_best_sellers))
BlockBestSellers::$cache_best_sellers = $this->getBestSellers($params);
$this->smarty->assign(array(
'best_sellers' => BlockBestSellers::$cache_best_sellers,
'display_link_bestsellers' => Configuration::get('PS_DISPLAY_BEST_SELLERS'),
'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')),
'smallSize' => Image::getSize(ImageType::getFormatedName('small'))
));
}
if (BlockBestSellers::$cache_best_sellers === false)
return false;
return $this->display(__FILE__, 'blockbestsellers.tpl', $this->getCacheId('blockbestsellers-col'));
}
|
blockbestsellers.tpl
Code: |
<ul class="colprods">
{foreach from=$best_sellers item=product name=myLoop}
<li{if $smarty.foreach.myLoop.last} class="last"{/if}>
<div class="left_block">
|
I read about {nocache} here, but getting just blank page. I am not programmer, so maybe doing smth bad...
Maybe someone can explain how exclude this?
Thank you very much for your time,
Regards. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Sat Oct 17, 2015 11:39 pm Post subject: |
|
|
You have to ask the people at prestashop how to disable caching for this module. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|