diff options
author | Thomas Steur <thomas.steur@gmail.com> | 2015-01-08 01:51:31 +0300 |
---|---|---|
committer | Thomas Steur <thomas.steur@gmail.com> | 2015-01-08 01:51:31 +0300 |
commit | 61b1f6c913bff5e43f8f9b0790700cc3c0c54718 (patch) | |
tree | b1d1e88b63ec3196a52869df472ed4a1d04e3b9f /plugins/Ecommerce/Controller.php | |
parent | 01e8a05fdb517cba9ef7ab2610c8af8209183430 (diff) |
better description for sales categories and make sure sales is shown when there are no conversions
Diffstat (limited to 'plugins/Ecommerce/Controller.php')
-rw-r--r-- | plugins/Ecommerce/Controller.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/plugins/Ecommerce/Controller.php b/plugins/Ecommerce/Controller.php index 9a06ec720f..99b427b01a 100644 --- a/plugins/Ecommerce/Controller.php +++ b/plugins/Ecommerce/Controller.php @@ -58,10 +58,17 @@ class Controller extends \Piwik\Plugins\Goals\Controller public function products() { $goal = $this->getMetricsForGoal(Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER); - $conversions = $goal['nb_conversions']; + $conversions = 0; + if (!empty($goal['nb_conversions'])) { + $conversions = $goal['nb_conversions']; + } $goal = $this->getMetricsForGoal(Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_CART); - $cartNbConversions = $goal['nb_conversions']; + + $cartNbConversions = 0; + if (!empty($goal) && array_key_exists('nb_conversions', $goal)) { + $cartNbConversions = $goal['nb_conversions']; + } $preloadAbandonedCart = $cartNbConversions !== false && $conversions == 0; |