Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattab <matthieu.aubry@gmail.com>2013-11-01 04:45:45 +0400
committermattab <matthieu.aubry@gmail.com>2013-11-01 04:45:45 +0400
commitf27cf4c9337617f6cf62978440b028d648043f01 (patch)
tree2006bb28618de11504b81a435be068a09f665592 /plugins/CustomVariables/Archiver.php
parentc97f71d6e9d1be061dd23083e1666f1991b52b1a (diff)
Removing a //FIXME : refactoring reserved custom variable slots for ecommerce view
Diffstat (limited to 'plugins/CustomVariables/Archiver.php')
-rw-r--r--plugins/CustomVariables/Archiver.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/CustomVariables/Archiver.php b/plugins/CustomVariables/Archiver.php
index 80ef438830..81a8755885 100644
--- a/plugins/CustomVariables/Archiver.php
+++ b/plugins/CustomVariables/Archiver.php
@@ -71,8 +71,8 @@ class Archiver extends \Piwik\Plugin\Archiver
// IF we query Custom Variables scope "page" either: Product SKU, Product Name,
// then we also query the "Product page view" price which was possibly recorded.
$additionalSelects = false;
- // FIXMEA
- if (in_array($slot, array(3, 4, 5))) {
+
+ if (in_array($slot, array(\PiwikTracker::CVAR_INDEX_ECOMMERCE_ITEM_SKU, \PiwikTracker::CVAR_INDEX_ECOMMERCE_ITEM_NAME, \PiwikTracker::CVAR_INDEX_ECOMMERCE_ITEM_CATEGORY))) {
$additionalSelects = array($this->getSelectAveragePrice());
}
$query = $this->getLogAggregator()->queryActionsByDimension($dimensions, $where, $additionalSelects);
@@ -84,7 +84,8 @@ class Archiver extends \Piwik\Plugin\Archiver
protected function getSelectAveragePrice()
{
- return LogAggregator::getSqlRevenue("AVG(log_link_visit_action.custom_var_v2)")
+ $field = "custom_var_v" . \PiwikTracker::CVAR_INDEX_ECOMMERCE_ITEM_PRICE;
+ return LogAggregator::getSqlRevenue("AVG(log_link_visit_action.{$field})")
. " as `" . Metrics::INDEX_ECOMMERCE_ITEM_PRICE_VIEWED . "`";
}