orders ; foreach($ordersArray as $order) { $order->init() ; $amount += $order->getAmount($type) ; } if ($format) { return Price::format($amount) ; } else { return $amount; } } }