diff options
Diffstat (limited to 'plugins/Ecommerce/ProfileSummary/EcommerceSummary.php')
-rw-r--r-- | plugins/Ecommerce/ProfileSummary/EcommerceSummary.php | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/plugins/Ecommerce/ProfileSummary/EcommerceSummary.php b/plugins/Ecommerce/ProfileSummary/EcommerceSummary.php new file mode 100644 index 0000000000..5761549aaf --- /dev/null +++ b/plugins/Ecommerce/ProfileSummary/EcommerceSummary.php @@ -0,0 +1,54 @@ +<?php +/** + * Piwik - free/libre analytics platform + * + * @link http://piwik.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + * + */ + +namespace Piwik\Plugins\Ecommerce\ProfileSummary; + +use Piwik\Common; +use Piwik\Piwik; +use Piwik\Plugins\Live\ProfileSummary\ProfileSummaryAbstract; +use Piwik\View; + +/** + * Class EcommerceSummary + * + * @api + */ +class EcommerceSummary extends ProfileSummaryAbstract +{ + /** + * @inheritdoc + */ + public function getName() + { + return Piwik::translate('Goals_Ecommerce'); + } + + /** + * @inheritdoc + */ + public function render() + { + if (empty($this->profile['totalEcommerceRevenue'])) { + return ''; + } + + $view = new View('@Ecommerce/_profileSummary.twig'); + $view->idSite = Common::getRequestVar('idSite', null, 'int'); + $view->visitorData = $this->profile; + return $view->render(); + } + + /** + * @inheritdoc + */ + public function getOrder() + { + return 20; + } +}
\ No newline at end of file |