[-] BO : there was some row doubled in the cart rules because of the multi-shop
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@15099 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
1 parent
771c75de15
commit
2bd2416cc0
1 file changed
+7
-3
@@ -309,7 +309,7 @@ class AdminCartRulesControllerCore extends AdminController
|
|||||||
case 'products':
|
case 'products':
|
||||||
$products = array('selected' => array(), 'unselected' => array());
|
$products = array('selected' => array(), 'unselected' => array());
|
||||||
$results = Db::getInstance()->executeS('
|
$results = Db::getInstance()->executeS('
|
||||||
SELECT name, p.id_product as id
|
SELECT DISTINCT name, p.id_product as id
|
||||||
FROM '._DB_PREFIX_.'product p
|
FROM '._DB_PREFIX_.'product p
|
||||||
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl
|
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl
|
||||||
ON (p.`id_product` = pl.`id_product`
|
ON (p.`id_product` = pl.`id_product`
|
||||||
@@ -350,8 +350,12 @@ class AdminCartRulesControllerCore extends AdminController
|
|||||||
case 'categories':
|
case 'categories':
|
||||||
$categories = array('selected' => array(), 'unselected' => array());
|
$categories = array('selected' => array(), 'unselected' => array());
|
||||||
$results = Db::getInstance()->executeS('
|
$results = Db::getInstance()->executeS('
|
||||||
SELECT name, id_category as id
|
SELECT DISTINCT name, c.id_category as id
|
||||||
FROM '._DB_PREFIX_.'category_lang pl
|
FROM '._DB_PREFIX_.'category c
|
||||||
|
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl
|
||||||
|
ON (c.`id_category` = cl.`id_category`
|
||||||
|
AND cl.`id_lang` = '.(int)Context::getContext()->language->id.Shop::addSqlRestrictionOnLang('cl').')
|
||||||
|
'.Shop::addSqlAssociation('category', 'c').'
|
||||||
WHERE id_lang = '.(int)Context::getContext()->language->id.'
|
WHERE id_lang = '.(int)Context::getContext()->language->id.'
|
||||||
ORDER BY name');
|
ORDER BY name');
|
||||||
foreach ($results as $row)
|
foreach ($results as $row)
|
||||||
|
|||||||
Reference in new issue
Block a user