getColumnPrefix() . '_revenue'; } public function getTranslatedName() { return Piwik::translate('%s ' . Piwik::translate('General_ColumnRevenue'), $this->getGoalName()); } public function getDocumentation() { return Piwik::translate('Goals_ColumnRevenueDocumentation', $this->getGoalNameForDocs()); } public function getDependentMetrics() { return array('goals'); } public function compute(Row $row) { $mappingFromNameToIdGoal = Metrics::getMappingFromNameToIdGoal(); $goalMetrics = $this->getGoalMetrics($row); return (float) $this->getMetric($goalMetrics, 'revenue', $mappingFromNameToIdGoal); } public function format($value, Formatter $formatter) { return $formatter->getPrettyMoney($value, $this->idSite); } public function beforeFormat($report, DataTable $table) { $this->idSite = DataTableFactory::getSiteIdFromMetadata($table); return !empty($this->idSite); // skip formatting if there is no site to get currency info from } }