// Improve Shop::getTotalShops()

This commit is contained in:
rMalie
2012-05-10 08:59:07 +00:00
parent a644192649
commit 2933d699f4
2 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -348,7 +348,7 @@ class HelperCore
public static function renderShopList() public static function renderShopList()
{ {
if (!Shop::isFeatureActive() || count(Shop::getShops(false, null, true)) < 2) if (!Shop::isFeatureActive() || Shop::getTotalShops(false, null) < 2)
return null; return null;
$tree = Shop::getTree(); $tree = Shop::getTree();
+5 -2
View File
@@ -505,6 +505,7 @@ class ShopCore extends ObjectModel
* @param bool $active * @param bool $active
* @param int $id_shop_group * @param int $id_shop_group
* @param bool $get_as_list_id * @param bool $get_as_list_id
* @return array
*/ */
public static function getShops($active = true, $id_shop_group = null, $get_as_list_id = false) public static function getShops($active = true, $id_shop_group = null, $get_as_list_id = false)
{ {
@@ -574,11 +575,13 @@ class ShopCore extends ObjectModel
} }
/** /**
* @param bool $active
* @param int $id_shop_group
* @return int Total of shops * @return int Total of shops
*/ */
public static function getTotalShops($active = true) public static function getTotalShops($active = true, $id_shop_group = null)
{ {
return count(Shop::getShops($active)); return count(Shop::getShops($active, $id_shop_group));
} }
/** /**