diff --git a/modules/order/src/Plugin/views/area/OrderTotal.php b/modules/order/src/Plugin/views/area/OrderTotal.php index 0fbf2ae1..e63909a5 100644 --- a/modules/order/src/Plugin/views/area/OrderTotal.php +++ b/modules/order/src/Plugin/views/area/OrderTotal.php @@ -79,12 +79,17 @@ class OrderTotal extends AreaPluginBase { if (!in_array($argument->getField(), ['commerce_order.order_id', 'commerce_order_item.order_id'])) { continue; } + /** @var \Drupal\commerce_order\Entity\OrderInterface $order */ if ($order = $this->orderStorage->load($argument->getValue())) { - return $order->get('total_price')->view(['label' => 'hidden', 'type' => 'commerce_order_total_summary']); + $order_total = $order->get('total_price')->view([ + 'label' => 'hidden', + 'type' => 'commerce_order_total_summary', + 'weight' => $this->position, + ]); + return $order_total; } } } - return []; } diff --git a/modules/order/templates/commerce-order-total-summary.html.twig b/modules/order/templates/commerce-order-total-summary.html.twig index 2be3907a..9a8b8f82 100644 --- a/modules/order/templates/commerce-order-total-summary.html.twig +++ b/modules/order/templates/commerce-order-total-summary.html.twig @@ -18,7 +18,7 @@ */ #} {{ attach_library('commerce_order/total_summary') }} -