You are here

function _commerce_webform_get_total_quantity_from_input_values in Commerce Webform 7.2

Same name and namespace in other branches
  1. 8 productfield.inc \_commerce_webform_get_total_quantity_from_input_values()

Get the total quantity selected from input values.

3 calls to _commerce_webform_get_total_quantity_from_input_values()
webform_conditional_operator_product_quantity_equals in ./productfield.inc
Webform conditionals comparison callback for product fields.
webform_conditional_operator_product_quantity_greater_than in ./productfield.inc
Webform conditionals comparison callback for product fields.
webform_conditional_operator_product_quantity_less_than in ./productfield.inc
Webform conditionals comparison callback for product fields.

File

./productfield.inc, line 1160

Code

function _commerce_webform_get_total_quantity_from_input_values($input_values) {
  $selected_products = _commerce_webform_get_selected_products_from_input_values($input_values);
  $total = 0;
  foreach ($selected_products as $product_id => $quantity) {
    $total += $quantity;
  }
  return $total;
}