From 5429fd67ff4aed03a9c20eb13bac43c24ce37be8 Mon Sep 17 00:00:00 2001 From: Jerome Nadaud Date: Tue, 10 Dec 2013 09:32:13 +0100 Subject: [PATCH] // Fix small warning in dashgoals --- modules/dashgoals/dashgoals.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/dashgoals/dashgoals.php b/modules/dashgoals/dashgoals.php index 636f646f0..0a8c27dfa 100644 --- a/modules/dashgoals/dashgoals.php +++ b/modules/dashgoals/dashgoals.php @@ -198,13 +198,13 @@ class Dashgoals extends Module $streams['traffic'][$stream_zone]['values'][] = $stream_values[$stream_zone]; $month_goal = ConfigurationKPI::get('DASHGOALS_CONVERSION_'.$i.'_'.$year); - $value = 100 * ((isset($visits[$timestamp]) && $visits[$timestamp]) ? ($orders[$timestamp] / $visits[$timestamp]) : 0); + $value = 100 * ((isset($visits[$timestamp]) && $visits[$timestamp] && isset($orders[$timestamp]) && $orders[$timestamp]) ? ($orders[$timestamp] / $visits[$timestamp]) : 0); $stream_values = $this->getValuesFromGoals($average_goals['conversion'], $month_goal, $value, Dashgoals::$month_labels[$i]); foreach ($stream_zones as $stream_zone) $streams['conversion'][$stream_zone]['values'][] = $stream_values[$stream_zone]; $month_goal = ConfigurationKPI::get('DASHGOALS_AVG_CART_VALUE_'.$i.'_'.$year); - $value = ((isset($orders[$timestamp]) && $orders[$timestamp]) ? ($sales[$timestamp] / $orders[$timestamp]) : 0); + $value = ((isset($orders[$timestamp]) && $orders[$timestamp] && isset($sales[$timestamp]) && $sales[$timestamp]) ? ($sales[$timestamp] / $orders[$timestamp]) : 0); $stream_values = $this->getValuesFromGoals($average_goals['avg_cart_value'], $month_goal, $value, Dashgoals::$month_labels[$i]); foreach ($stream_zones as $stream_zone) $streams['avg_cart_value'][$stream_zone]['values'][] = $stream_values[$stream_zone];