You are here

protected function CommerceReportsBaseTestCase::getTotal in Commerce Reporting 7.4

4 calls to CommerceReportsBaseTestCase::getTotal()
CommerceReportsSalesOverviewTestCase::testMonthlyOverview in src/Tests/CommerceReportsSalesOverviewTestCase.php
CommerceReportsSalesOverviewTestCase::testOutsideOverviewScope in src/Tests/CommerceReportsSalesOverviewTestCase.php
CommerceReportsSalesOverviewTestCase::testTodayOverview in src/Tests/CommerceReportsSalesOverviewTestCase.php
CommerceReportsSalesOverviewTestCase::testYesterdayOverview in src/Tests/CommerceReportsSalesOverviewTestCase.php

File

src/Tests/CommerceReportsBaseTestCase.php, line 193

Class

CommerceReportsBaseTestCase
Class CommerceReportsBaseTestCase

Namespace

Drupal\commerce_reports\Tests

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[LANGUAGE_NONE][0]['amount'];
    }
  }
  return $total;
}