From a8fd55fa4bbc559a2748e61804bff4f047c42c4d Mon Sep 17 00:00:00 2001 From: lLefevre Date: Mon, 27 Aug 2012 15:49:07 +0000 Subject: [PATCH] [-] MO : mailalert : Fix duplicate result git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17028 b9a71923-0436-4b27-9f14-aed3839534dd --- modules/mailalerts/MailAlert.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/mailalerts/MailAlert.php b/modules/mailalerts/MailAlert.php index 6c4afabe4..d620fc93a 100644 --- a/modules/mailalerts/MailAlert.php +++ b/modules/mailalerts/MailAlert.php @@ -212,12 +212,11 @@ class MailAlert extends ObjectModel $sql = ' SELECT ma.`id_product`, p.`quantity` AS product_quantity, pl.`name`, ma.`id_product_attribute` FROM `'._DB_PREFIX_.self::$definition['table'].'` ma - JOIN `'._DB_PREFIX_.'product` p ON p.`id_product` = ma.`id_product` + JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product` = ma.`id_product`) '.Shop::addSqlAssociation('product', 'p').' - JOIN `'._DB_PREFIX_.'product_lang` pl ON pl.`id_product` = ma.`id_product` + LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.`id_product` = p.`id_product` AND pl.id_shop IN ('.implode(', ', Shop::getContextListShopID(false)).')) WHERE product_shop.`active` = 1 - AND (ma.`id_customer` = '.(int)$customer->id.' - OR ma.`customer_email` = \''.pSQL($customer->email).'\') + AND (ma.`id_customer` = '.(int)$customer->id.' OR ma.`customer_email` = \''.pSQL($customer->email).'\') AND pl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestriction(false, 'ma'); return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);