getTimeSettings();
$this->title = $prefix.__('E-Commerce', 'wp-piwik');
$this->method = 'Goals.get';
$this->parameter = array(
'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId),
'period' => $timeSettings['period'],
'date' => $timeSettings['date']
);
}
public function show() {
$response = self::$wpPiwik->request($this->apiID[$this->method]);
if (!empty($response['result']) && $response['result'] ='error')
echo ''.__('Piwik error', 'wp-piwik').': '.htmlentities($response['message'], ENT_QUOTES, 'utf-8');
else {
$tableHead = null;
$tableBody = array(
array(__('Conversions', 'wp-piwik').':', $this->value($response, 'nb_conversions')),
array(__('Visits converted', 'wp-piwik').':', $this->value($response, 'nb_visits_converted')),
array(__('Revenue', 'wp-piwik').':', number_format($this->value($response, 'revenue'),2)),
array(__('Conversion rate', 'wp-piwik').':', $this->value($response, 'conversion_rate')),
array(__('Conversions (new visitor)', 'wp-piwik').':', $this->value($response, 'nb_conversions_new_visit')),
array(__('Visits converted (new visitor)', 'wp-piwik').':', $this->value($response, 'nb_visits_converted_new_visit')),
array(__('Revenue (new visitor)', 'wp-piwik').':', number_format($this->value($response, 'revenue_new_visit'),2)),
array(__('Conversion rate (new visitor)', 'wp-piwik').':', $this->value($response, 'conversion_rate_new_visit')),
array(__('Conversions (returning visitor)', 'wp-piwik').':', $this->value($response, 'nb_conversions_returning_visit')),
array(__('Visits converted (returning visitor)', 'wp-piwik').':', $this->value($response, 'nb_visits_converted_returning_visit')),
array(__('Revenue (returning visitor)', 'wp-piwik').':', number_format($this->value($response, 'revenue_returning_visit'),2)),
array(__('Conversion rate (returning visitor)', 'wp-piwik').':', $this->value($response, 'conversion_rate_returning_visit')),
);
$tableFoot = (self::$settings->getGlobalOption('piwik_shortcut')?array(__('Shortcut', 'wp-piwik').':', 'Piwik'.(isset($aryConf['inline']) && $aryConf['inline']?' - WP-Piwik':'')):null);
$this->table($tableHead, $tableBody, $tableFoot);
}
}
}