Skip to content
Extraits de code Groupes Projets
Valider e6b6d8a6 rédigé par diosmosis's avatar diosmosis
Parcourir les fichiers

Refs #3116, make summary row label readable in ecommerce goals reports and add...

Refs #3116, make summary row label readable in ecommerce goals reports and add tests for those changes.
parent 5444603d
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Affichage de
avec 120 ajouts et 1 suppression
......@@ -212,6 +212,7 @@ class Piwik_Goals_API
$dataTable = $archive->getDataTable($recordNameFinal);
$dataTable->filter('Sort', array(Piwik_Archive::INDEX_ECOMMERCE_ITEM_REVENUE));
$dataTable->queueFilter('ReplaceColumnNames');
$dataTable->queueFilter('ReplaceSummaryRowLabel');
$ordersColumn = 'orders';
if ($abandonedCarts) {
......
......@@ -15,6 +15,12 @@ class Test_Piwik_Fixture_ManyVisitsWithMockLocationProvider extends Test_Piwik_B
{
public $idSite = 1;
public $dateTime = '2010-01-03 01:22:33';
public $nextDay = null;
public function __construct()
{
$this->nextDay = Piwik_Date::factory($this->dateTime)->addDay(1)->getDatetime();
}
public function setUp()
{
......@@ -107,6 +113,9 @@ class Test_Piwik_Fixture_ManyVisitsWithMockLocationProvider extends Test_Piwik_B
// track outlinks
$this->trackActions($t, $visitorCounter, 'outlink', $userAgents, $resolutions);
// track ecommerce product orders
$this->trackOrders($t);
}
private function trackActions($t, &$visitorCounter, $actionType, $userAgents, $resolutions,
......@@ -159,6 +168,21 @@ class Test_Piwik_Fixture_ManyVisitsWithMockLocationProvider extends Test_Piwik_B
}
}
}
private function trackOrders($t)
{
$nextDay = Piwik_Date::factory($this->nextDay);
$t->setForceVisitDateTime($nextDay);
for ($i = 0; $i != 25; ++$i) {
$cat = $i % 5;
$t->setNewVisitorId();
$t->setIp("155.5.4.$i");
$t->setEcommerceView("id_book$i", "Book$i", "Books Cat #$cat", 7.50);
self::checkResponse($t->doTrackPageView('bought book'));
}
}
private function trackAction($t, $actionType, $visitorCounter, $actionNum)
{
......
......@@ -35,11 +35,17 @@ class Test_Piwik_Integration_BlobReportLimitingTest extends IntegrationTestCase
'UserSettings.getBrowserVersion',
'UserCountry.getRegion', 'UserCountry.getCity',
);
$ecommerceApi = array('Goals.getItemsSku', 'Goals.getItemsName', 'Goals.getItemsCategory');
return array(
array($apiToCall, array('idSite' => self::$fixture->idSite,
'date' => self::$fixture->dateTime,
'periods' => array('day')))
'periods' => array('day'))),
array($ecommerceApi, array('idSite' => self::$fixture->idSite,
'date' => self::$fixture->nextDay,
'periods' => 'day')),
);
}
......
<?xml version="1.0" encoding="utf-8" ?>
<result>
<row>
<label>Books Cat #0</label>
<nb_uniq_visitors>5</nb_uniq_visitors>
<nb_visits>5</nb_visits>
<nb_actions>5</nb_actions>
<avg_price>7.5</avg_price>
<avg_quantity>0</avg_quantity>
<conversion_rate>0%</conversion_rate>
</row>
<row>
<label>Others</label>
<nb_uniq_visitors>20</nb_uniq_visitors>
<nb_visits>20</nb_visits>
<nb_actions>20</nb_actions>
<avg_price>30</avg_price>
<avg_quantity>0</avg_quantity>
<conversion_rate>0%</conversion_rate>
</row>
</result>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<result>
<row>
<label>Book0</label>
<nb_uniq_visitors>1</nb_uniq_visitors>
<nb_visits>1</nb_visits>
<nb_actions>1</nb_actions>
<avg_price>7.5</avg_price>
<avg_quantity>0</avg_quantity>
<conversion_rate>0%</conversion_rate>
</row>
<row>
<label>Others</label>
<nb_uniq_visitors>24</nb_uniq_visitors>
<nb_visits>24</nb_visits>
<nb_actions>24</nb_actions>
<avg_price>180</avg_price>
<avg_quantity>0</avg_quantity>
<conversion_rate>0%</conversion_rate>
</row>
</result>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<result />
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<result>
<row>
<label>Books Cat #0</label>
<nb_uniq_visitors>5</nb_uniq_visitors>
<nb_visits>5</nb_visits>
<nb_actions>5</nb_actions>
<avg_price>7.5</avg_price>
<avg_quantity>0</avg_quantity>
<conversion_rate>0%</conversion_rate>
</row>
<row>
<label>Others</label>
<nb_uniq_visitors>20</nb_uniq_visitors>
<nb_visits>20</nb_visits>
<nb_actions>20</nb_actions>
<avg_price>30</avg_price>
<avg_quantity>0</avg_quantity>
<conversion_rate>0%</conversion_rate>
</row>
</result>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<result>
<row>
<label>Book0</label>
<nb_uniq_visitors>1</nb_uniq_visitors>
<nb_visits>1</nb_visits>
<nb_actions>1</nb_actions>
<avg_price>7.5</avg_price>
<avg_quantity>0</avg_quantity>
<conversion_rate>0%</conversion_rate>
</row>
<row>
<label>Others</label>
<nb_uniq_visitors>24</nb_uniq_visitors>
<nb_visits>24</nb_visits>
<nb_actions>24</nb_actions>
<avg_price>180</avg_price>
<avg_quantity>0</avg_quantity>
<conversion_rate>0%</conversion_rate>
</row>
</result>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<result />
\ No newline at end of file
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter