diff options
author | Stefan Giehl <stefan@piwik.org> | 2017-06-18 22:40:34 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-18 22:40:34 +0300 |
commit | 6b860f9d73ffe8e6f6ac0aebb19b1e8c5d6d4c5e (patch) | |
tree | 27c22b080f099c4685c34a8a073666e3fc614814 /plugins/Ecommerce/Controller.php | |
parent | 969fe64bd126804482681a454e8ba64801e18e2a (diff) |
Make it possible to view Ecommerce Log with segment (#11801)
* Make it possible to view Ecommerce Log with segment
* adds UI test for segmented ecommerce log
* adds screenshot for UI test
* use Http::buildQuery()
Diffstat (limited to 'plugins/Ecommerce/Controller.php')
-rw-r--r-- | plugins/Ecommerce/Controller.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/plugins/Ecommerce/Controller.php b/plugins/Ecommerce/Controller.php index c1716a5808..c0215a1bb4 100644 --- a/plugins/Ecommerce/Controller.php +++ b/plugins/Ecommerce/Controller.php @@ -10,8 +10,8 @@ namespace Piwik\Plugins\Ecommerce; use Piwik\API\Request; use Piwik\Common; -use Piwik\DataTable; use Piwik\FrontController; +use Piwik\Http; use Piwik\Piwik; use Piwik\Plugins\Goals\API as GoalsApi; use Piwik\Translation\Translator; @@ -97,10 +97,19 @@ class Controller extends \Piwik\Plugins\Goals\Controller public function getEcommerceLog($fetch = false) { $saveGET = $_GET; - $_GET['segment'] = urlencode('visitEcommerceStatus!=none'); + $originalQuery = $_SERVER['QUERY_STRING']; + + if (!empty($_GET['segment'])) { + $_GET['segment'] = $_GET['segment'] . ';' . 'visitEcommerceStatus!=none'; + } else { + $_GET['segment'] = 'visitEcommerceStatus!=none'; + } + $_SERVER['QUERY_STRING'] = Http::buildQuery($_GET); + $_GET['widget'] = 1; $output = FrontController::getInstance()->dispatch('Live', 'getVisitorLog', array($fetch)); $_GET = $saveGET; + $_SERVER['QUERY_STRING'] = $originalQuery; return $output; } |