/*
* changes the $whereStatus variable
* return true or false, if false, this will influence whole sql query which will be completely ignored
*/
public static function setWhereByOrderStatus(&$whereStatus)
{
$paramsC = PhocacartUtils::getComponentParameters();
$statistics_order_status = $paramsC->get('statistics_order_status', array(-1));
if (in_array(-1, $statistics_order_status)) {
// All order statuses are set in statistics, where clause not needed
return true;
} else {
if (in_array(0, $statistics_order_status)) {
// No status selected, no statistics, where clause not needed
return false;
} else {
// Only some statuses selected, so where clause changed
$whereStatus = 'a.status_id IN (' . implode(',', $statistics_order_status) . ')';
return true;
}
}
return false;
}