[-] BO : Bug fixed related to #PSCFV-1354 - Specific price with multishop, groups/currencies/countries should vary in function of the selected shop

This commit is contained in:
fBrignoli
2012-05-16 15:51:22 +00:00
parent 604b572ed2
commit bf66f03fd7
5 changed files with 57 additions and 6 deletions
+7 -1
View File
@@ -71,12 +71,18 @@ class GroupCore extends ObjectModel
protected $webserviceParameters = array();
public static function getGroups($id_lang)
public static function getGroups($id_lang, $id_shop = false)
{
$shop_criteria = '';
if ($id_shop)
$shop_criteria = 'LEFT JOIN `'._DB_PREFIX_.'group_shop` gs ON (gs.`id_group` = g.`id_group`)
WHERE `id_shop` = '.(int)$id_shop;
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
SELECT g.`id_group`, g.`reduction`, g.`price_display_method`, gl.`name`
FROM `'._DB_PREFIX_.'group` g
LEFT JOIN `'._DB_PREFIX_.'group_lang` AS gl ON (g.`id_group` = gl.`id_group` AND gl.`id_lang` = '.(int)$id_lang.')
'.$shop_criteria.'
ORDER BY g.`id_group` ASC');
}