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:
authorStefan Giehl <stefan@matomo.org>2020-06-30 00:30:36 +0300
committerGitHub <noreply@github.com>2020-06-30 00:30:36 +0300
commit544cbc826296cab3db3fd7c6eace2c14ec41245a (patch)
treecb543deb604ac31215a8e1a95f8883d9b371263e /plugins/Ecommerce
parent10584d765f543858d1d97e7b1c48c1cb1aec5353 (diff)
Fix names of viewed product category dimensions (#16132)
Diffstat (limited to 'plugins/Ecommerce')
-rw-r--r--plugins/Ecommerce/Columns/ProductViewCategory.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/plugins/Ecommerce/Columns/ProductViewCategory.php b/plugins/Ecommerce/Columns/ProductViewCategory.php
index a59cd39b2a..0488c6c3a2 100644
--- a/plugins/Ecommerce/Columns/ProductViewCategory.php
+++ b/plugins/Ecommerce/Columns/ProductViewCategory.php
@@ -14,6 +14,7 @@ use Piwik\Columns\Join\ActionNameJoin;
use Piwik\Common;
use Piwik\Db;
use Piwik\Log;
+use Piwik\Piwik;
use Piwik\Plugin\Dimension\ActionDimension;
use Piwik\Plugin\Segment;
use Piwik\Segment\SegmentsList;
@@ -31,6 +32,11 @@ class ProductViewCategory extends ActionDimension
protected $category = 'Goals_Ecommerce';
protected $categoryNumber = 1;
+ public function getName()
+ {
+ return parent::getName() . ' ' . $this->categoryNumber;
+ }
+
public function configureSegments(SegmentsList $segmentsList, DimensionSegmentFactory $dimensionSegmentFactory)
{
$individualProductCategorySegments = $this->getProductCategorySegments(ProductCategory::PRODUCT_CATEGORY_COUNT);
@@ -45,7 +51,7 @@ class ProductViewCategory extends ActionDimension
$segment = new Segment();
$segment->setCategory($this->category);
$segment->setType('dimension');
- $segment->setName($this->getName() . ' ' . ($i + 1));
+ $segment->setName(Piwik::translate('Ecommerce_ViewedProductCategory') . ' ' . ($i + 1));
$segment->setSegment($productCategoryName);
$segment->setSqlFilter('\\Piwik\\Tracker\\TableLogAction::getIdActionFromSegment');
$segment->setSqlSegment('log_link_visit_action.' . $productCategoryColumnName);
@@ -69,7 +75,7 @@ class ProductViewCategory extends ActionDimension
$segment->setCategory($this->category);
$segment->setType('dimension');
$segment->setSegment('productViewCategory');
- $segment->setName($this->getName());
+ $segment->setName(Piwik::translate('Ecommerce_ViewedProductCategory'));
$segment->setUnionOfSegments($individualProductCategorySegments);
$segmentsList->addSegment($dimensionSegmentFactory->createSegment($segment));
}