[-] BO : fix #PSCFV-2322 - cannot deactivate multishop with only one shop

This commit is contained in:
tDidierjean
2012-05-18 14:04:03 +00:00
parent 76fd39ba23
commit 83a8b63860
+9 -2
View File
@@ -761,11 +761,18 @@ class ShopCore extends ObjectModel
}
/**
* @return bool Return true if multishop feature is activated
* @return bool Return true if multishop feature is active and at last 2 shops have been created
*/
public static function isFeatureActive()
{
return Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE');
if (!Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE'))
return false;
static $total = null;
if (is_null($total))
$total = Db::getInstance()->getValue('SELECT COUNT(*) FROM '._DB_PREFIX_.'shop');
return ($total > 1) ? true : false;
}
public function copyShopData($old_id, $tables_import = false, $deleted = false)