You are here

function uc_line_items_calculate in Ubercart 7.3

Same name and namespace in other branches
  1. 5 uc_order/uc_order_line_item.inc \uc_line_items_calculate()
  2. 6.2 uc_order/uc_order.line_item.inc \uc_line_items_calculate()

Calculates the total value of line items of types that should be calculated.

1 call to uc_line_items_calculate()
uc_order_get_total in uc_order/uc_order.module
Calculates an order's total.

File

uc_order/uc_order.line_item.inc, line 47
Contains the callbacks for the default line items for orders and the various functions that make line items work.

Code

function uc_line_items_calculate($order) {
  $total = 0;
  if (is_array($order->line_items)) {
    foreach ($order->line_items as $item) {
      if (_uc_line_item_data($item['type'], 'calculated') == TRUE) {
        $total += $item['amount'];
      }
    }
  }
  return $total;
}