// MERGE with 1.4 r7770

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@7776 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2011-07-28 09:20:57 +00:00
parent df255f66c1
commit a875fecb20
968 changed files with 26082 additions and 3937 deletions
+8 -14
View File
@@ -82,7 +82,7 @@ class GroupCore extends ObjectModel
return parent::getTranslationsFields(array('name'));
}
static public function getGroups($id_lang)
public static function getGroups($id_lang)
{
return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
SELECT g.`id_group`, g.`reduction`, g.`price_display_method`, gl.`name`
@@ -110,21 +110,15 @@ class GroupCore extends ObjectModel
'.($limit > 0 ? 'LIMIT '.(int)$start.', '.(int)$limit : ''));
}
static public function getReduction($id_customer = NULL)
public static function getReduction($id_customer = NULL)
{
if ($id_customer === NULL)
$id_customer = 0;
if (!isset(self::$_cacheReduction['customer'][$id_customer]))
{
if ($id_customer)
$customer = new Customer((int)($id_customer));
self::$_cacheReduction['customer'][$id_customer] = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
if (!isset(self::$_cacheReduction['customer'][(int)$id_customer]))
self::$_cacheReduction['customer'][(int)$id_customer] = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
SELECT `reduction`
FROM `'._DB_PREFIX_.'group`
WHERE `id_group` = '.((isset($customer) AND Validate::isLoadedObject($customer)) ? (int)($customer->id_default_group) : 1));
WHERE `id_group` = '.((int)$id_customer ? Customer::getDefaultGroupId((int)$id_customer) : 1));
return self::$_cacheReduction['customer'][(int)$id_customer];
}
return self::$_cacheReduction['customer'][$id_customer];
}
public static function getReductionByIdGroup($id_group)
{
@@ -138,7 +132,7 @@ class GroupCore extends ObjectModel
return self::$_cacheReduction['group'][$id_group];
}
static public function getPriceDisplayMethod($id_group)
public static function getPriceDisplayMethod($id_group)
{
if (!isset(self::$_groupPriceDisplayMethod[$id_group]))
self::$_groupPriceDisplayMethod[$id_group] = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
@@ -148,7 +142,7 @@ class GroupCore extends ObjectModel
return self::$_groupPriceDisplayMethod[$id_group];
}
static public function getDefaultPriceDisplayMethod()
public static function getDefaultPriceDisplayMethod()
{
return self::getPriceDisplayMethod(1);
}