From 5d8d7c03838cd1e5b027e19a1e75e0e7f152f0e5 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Thu, 11 Jul 2013 18:57:37 +0200 Subject: [PATCH] [-] MO : Followup : don't send emails for empty carts thanks @axometeam --- modules/followup/followup.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/followup/followup.php b/modules/followup/followup.php index 3ab469b4c..407593723 100644 --- a/modules/followup/followup.php +++ b/modules/followup/followup.php @@ -280,11 +280,9 @@ class Followup extends Module SELECT c.id_cart, c.id_lang, cu.id_customer, cu.firstname, cu.lastname, cu.email FROM '._DB_PREFIX_.'cart c LEFT JOIN '._DB_PREFIX_.'orders o ON (o.id_cart = c.id_cart) - LEFT JOIN '._DB_PREFIX_.'customer cu ON (cu.id_customer = c.id_customer) - WHERE DATE_SUB(CURDATE(),INTERVAL 7 DAY) <= c.date_add - AND cu.id_customer IS NOT NULL - AND cu.is_guest = 0 - AND o.id_order IS NULL'; + RIGHT JOIN '._DB_PREFIX_.'customer cu ON (cu.id_customer = c.id_customer) + RIGHT JOIN '._DB_PREFIX_.'cart_product cp ON (cp.id_cart = c.id_cart) + WHERE DATE_SUB(CURDATE(),INTERVAL 7 DAY) <= c.date_add AND o.id_order IS NULL'; if(!empty($emailLogs)) $sql .= ' AND c.id_cart NOT IN ('.join(',', $emailLogs).')';