You are here

function hook_commerce_payment_totals_row_info_alter in Commerce Core 7

Allows you to alter payment totals rows.

Parameters

$rows: Array of payment totals rows exposed by hook_commerce_payment_totals_row_info() implementations.

$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.

See also

hook_commerce_payment_totals_row_info()

1 invocation of hook_commerce_payment_totals_row_info_alter()
commerce_payment_totals_rows in modules/payment/commerce_payment.module
Returns a sorted array of payment totals table rows.

File

modules/payment/commerce_payment.api.php, line 69
Hooks provided by the Payment module.

Code

function hook_commerce_payment_totals_row_info_alter(&$rows, $totals, $order) {

  // Alter the weight of order balance rows to appear first.
  foreach ($rows as $key => &$row) {
    if (in_array('order-balance', $row['class'])) {
      $row['weight'] = -10;
    }
  }
}