protected function CommerceReportsBaseTestCase::getTotal in Commerce Reporting 7.3
4 calls to CommerceReportsBaseTestCase::getTotal()
- CommerceReportsSalesOverviewTestCase::testMonthlyOverview in tests/
commerce_reports.test - CommerceReportsSalesOverviewTestCase::testOutsideOverviewScope in tests/
commerce_reports.test - CommerceReportsSalesOverviewTestCase::testTodayOverview in tests/
commerce_reports.test - CommerceReportsSalesOverviewTestCase::testYesterdayOverview in tests/
commerce_reports.test
File
- tests/
commerce_reports.test, line 99 - Unit tests for the commerce reports module.
Class
- CommerceReportsBaseTestCase
- @file Unit tests for the commerce reports module.
Code
protected function getTotal() {
$total = 0;
foreach ($this->orders as $order) {
foreach ($order['products'] as $product_id => $quantity) {
$total += $quantity * $this->products[$product_id]->commerce_price['und'][0]['amount'];
}
}
return $total;
}