You are here

function uc_order_get_product_count in Ubercart 7.3

Same name and namespace in other branches
  1. 6.2 uc_order/uc_order.module \uc_order_get_product_count()

Calculates an order's product count.

2 calls to uc_order_get_product_count()
UcOrderController::attachLoad in uc_order/uc_order.controller.inc
Attaches data to entities upon loading.
uc_order_save in uc_order/uc_order.module
Entity API "save callback" for uc_order entity.

File

uc_order/uc_order.module, line 1694

Code

function uc_order_get_product_count($order) {
  $count = 0;
  if (is_array($order->products)) {
    foreach ($order->products as $product) {
      $count += $product->qty;
    }
  }
  return $count;
}