Hi,
Change the code:
function onAcyProcessFilter_hikaorder(&$query,$filter,$num){
if(!$this->loadAcymailing()) return;
$config =& hikashop_config();
$statuses = explode(',',$config->get('invoice_order_statuses','confirmed,shipped'));
$condition = array();
foreach($statuses as $status){
$condition[] = $query->db->Quote($status);
}
$myquery = "SELECT DISTINCT b.user_email
FROM #__hikashop_order_product AS a
LEFT JOIN #__hikashop_order AS c ON a.order_id = c.order_id
LEFT JOIN #__hikashop_user AS b on c.order_user_id = b.user_id
WHERE c.order_status IN (".implode(',',$condition).")";
if(!empty($filter['product']) AND is_numeric($filter['product'])) $myquery .= " AND a.product_id = ".(int) $filter['product'];
elseif(!empty($filter['cat']) AND is_numeric($filter['cat'])) $myquery .= " AND a.product_id IN (SELECT product_id FROM #__hikashop_product_category WHERE category_id = ".$filter['cat'].")";
$datesVar = array('creationdatesup','creationdateinf');
foreach($datesVar as $oneDate){
if(empty($filter[$oneDate])) continue;
$filter[$oneDate] = acymailing_replaceDate($filter[$oneDate]);
if(!is_numeric($filter[$oneDate])) $filter[$oneDate] = strtotime($filter[$oneDate]);
}
if(empty($filter['datefield'])) $filter['datefield'] = 'order_created';
if(!empty($filter['creationdateinf'])) $myquery .= ' AND c.`'.$filter['datefield'].'` > '.$filter['creationdateinf'];
if(!empty($filter['creationdatesup'])) $myquery .= ' AND c.`'.$filter['datefield'].'` < '.$filter['creationdatesup'];
$query->db->setQuery($myquery);
$allEmails = acymailing_loadResultArray($query->db);
if(empty($allEmails)) $allEmails[] = 'none';
if(empty($filter['type'])){
$query->where[] = "sub.email NOT IN ('".implode("','",$allEmails)."')";
}else{
$query->where[] = "sub.email IN ('".implode("','",$allEmails)."')";
}
}
to:
function onAcyProcessFilter_hikaorder(&$query,$filter,$num){
if(!$this->loadAcymailing()) return;
$config =& hikashop_config();
$statuses = $config->get('invoice_order_statuses','confirmed,shipped');
if(empty($statuses)) $statuses = 'confirmed,shipped';
$statuses = explode(',',$statuses);
$condition = array();
foreach($statuses as $status){
if(!empty($status)) $condition[] = $query->db->Quote($status);
}
$myquery = "SELECT DISTINCT b.user_email
FROM #__hikashop_order_product AS a
LEFT JOIN #__hikashop_order AS c ON a.order_id = c.order_id
LEFT JOIN #__hikashop_user AS b on c.order_user_id = b.user_id";
$filters = array();
if(count($condition)) $filters[] = "c.order_status IN (".implode(',',$condition).")";
if(!empty($filter['product']) AND is_numeric($filter['product'])) $filters[] = "a.product_id = ".(int) $filter['product'];
elseif(!empty($filter['cat']) AND is_numeric($filter['cat'])) $filters[] = "a.product_id IN (SELECT product_id FROM #__hikashop_product_category WHERE category_id = ".$filter['cat'].")";
$datesVar = array('creationdatesup','creationdateinf');
foreach($datesVar as $oneDate){
if(empty($filter[$oneDate])) continue;
$filter[$oneDate] = acymailing_replaceDate($filter[$oneDate]);
if(!is_numeric($filter[$oneDate])) $filter[$oneDate] = strtotime($filter[$oneDate]);
}
if(empty($filter['datefield'])) $filter['datefield'] = 'order_created';
if(!empty($filter['creationdateinf'])) $filters[] = 'c.`'.$filter['datefield'].'` > '.$filter['creationdateinf'];
if(!empty($filter['creationdatesup'])) $filters[] = 'c.`'.$filter['datefield'].'` < '.$filter['creationdatesup'];
if(count($filters)){
$myquery.=' WHERE '.implode(' AND ',$filters);
}
$query->db->setQuery($myquery);
$allEmails = acymailing_loadResultArray($query->db);
if(empty($allEmails)) $allEmails[] = 'none';
if(empty($filter['type'])){
$query->where[] = "sub.email NOT IN ('".implode("','",$allEmails)."')";
}else{
$query->where[] = "sub.email IN ('".implode("','",$allEmails)."')";
}
}
in the file plugins/acymailing/hikashop/hikashop.php and that should fix the problem.