[*] MO: Improve performance with smarty cache on blocktopmenu

This commit is contained in:
rGaillard
2012-05-29 09:28:53 +00:00
parent eb71ac91dc
commit 8856465a23
2 changed files with 21 additions and 13 deletions
+4 -6
View File
@@ -787,14 +787,12 @@ class ShopCore extends ObjectModel
*/
public static function isFeatureActive()
{
if (!Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE'))
return false;
static $feature_active = null;
static $total = null;
if ($feature_active === null)
$feature_active = Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE') && (count(Db::getInstance()->getValue('SELECT COUNT(*) FROM '._DB_PREFIX_.'shop')) > 1);
if (is_null($total))
$total = Db::getInstance()->getValue('SELECT COUNT(*) FROM '._DB_PREFIX_.'shop');
return ($total > 1) ? true : false;
return $feature_active;
}
public function copyShopData($old_id, $tables_import = false, $deleted = false)