function commerce_checkout_preprocess_commerce_checkout_order_summary in Commerce Core 8.2
Implements hook_preprocess_HOOK().
File
- modules/
checkout/ commerce_checkout.module, line 83 - Provides configurable checkout flows.
Code
function commerce_checkout_preprocess_commerce_checkout_order_summary(&$variables) {
/** @var \Drupal\commerce_order\Entity\OrderInterface $order */
$order = $variables['order_entity'];
/** @var \Drupal\commerce_order\OrderTotalSummaryInterface $order_total_summary */
$order_total_summary = \Drupal::service('commerce_order.order_total_summary');
$variables['totals'] = $order_total_summary
->buildTotals($order);
$variables['rendered_totals'] = [
'#theme' => 'commerce_order_total_summary',
'#order_entity' => $order,
'#totals' => $variables['totals'],
];
}