// Improve Shop::getTotalShops()
This commit is contained in:
@@ -348,7 +348,7 @@ class HelperCore
|
||||
|
||||
public static function renderShopList()
|
||||
{
|
||||
if (!Shop::isFeatureActive() || count(Shop::getShops(false, null, true)) < 2)
|
||||
if (!Shop::isFeatureActive() || Shop::getTotalShops(false, null) < 2)
|
||||
return null;
|
||||
|
||||
$tree = Shop::getTree();
|
||||
|
||||
@@ -505,6 +505,7 @@ class ShopCore extends ObjectModel
|
||||
* @param bool $active
|
||||
* @param int $id_shop_group
|
||||
* @param bool $get_as_list_id
|
||||
* @return array
|
||||
*/
|
||||
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
|
||||
*/
|
||||
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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user