You are here

function commerce_payment_totals_rows in Commerce Core 7

Returns a sorted array of payment totals table rows.

Parameters

$totals: An array of payment totals whose keys are currency codes and values are the total amount paid in each currency.

$order: If available, the order object to which the payments apply.

Return value

An array of table row data as expected by theme_table().

See also

hook_commerce_payment_totals_row_info()

1 call to commerce_payment_totals_rows()
commerce_payment_handler_area_totals::render in modules/payment/includes/views/handlers/commerce_payment_handler_area_totals.inc
Render the area.

File

modules/payment/commerce_payment.module, line 1153
Defines the payment system and checkout integration.

Code

function commerce_payment_totals_rows($totals, $order) {

  // Retrieve rows defined by the hook and allow other modules to alter them.
  $rows = module_invoke_all('commerce_payment_totals_row_info', $totals, $order);
  drupal_alter('commerce_payment_totals_row_info', $rows, $totals, $order);

  // Sort the rows by weight and return the array.
  uasort($rows, 'drupal_sort_weight');
  return $rows;
}