fix name of key

This commit is contained in:
Marion Muszynski 2017-11-21 10:21:19 +01:00
parent b6283cf4ae
commit acbc72a32c

View File

@ -23,23 +23,23 @@ class Privatesales_Family_Menu extends Module {
public function hooktopMenu($params) {
global $cookie, $smarty;
$id_lang = (int)$cookie->id_lang;
$id_lang = (int)$cookie->id_lang;
/**
* @Override cache file
*/
if (class_exists('CacheRedis')) {
$tpl_cache_name = 'sale_privatesales_family_menu_'.(int) $cookie->id_lang.'.html';
if (false === ($result = CacheRedis::getInstance()->get($tpl_cache_name, 'privatesales_family_menu'))) {
if (false === ($result = CacheRedis::getInstance()->get($tpl_cache_name, 'sale_privatesales_family_menu'))) {
$menus = $this->getTree($cookie->id_lang);
if (!$menus) {
CacheRedis::getInstance()->set($tpl_cache_name, 'privatesales_family_menu', '', CacheRedis::MEDIUM_TTL);
CacheRedis::getInstance()->set($tpl_cache_name, 'sale_privatesales_family_menu', '', CacheRedis::MEDIUM_TTL);
return "";
}
$smarty->assign(array(
'menus' => $menus
));
$result = $this->display(__FILE__, 'menu.tpl');
CacheRedis::getInstance()->set($tpl_cache_name, 'privatesales_family_menu', $result, CacheRedis::MEDIUM_TTL);
CacheRedis::getInstance()->set($tpl_cache_name, 'sale_privatesales_family_menu', $result, CacheRedis::MEDIUM_TTL);
}
} else {
$filename = _PS_ROOT_DIR_.'/modules/privatesales_family_menu/menu_'.$id_lang.'.txt';
@ -66,7 +66,7 @@ class Privatesales_Family_Menu extends Module {
public function hookPrivateSales_update($params)
{
if (class_exists('CacheRedis')) {
CacheRedis::getInstance()->clear('sale_privatesales*');
CacheRedis::getInstance()->clear('sale*');
}
$id_langs = array(2,3);
foreach ($id_langs as $key => $id_lang) {