public function getVariables()
    {
        $variables = [];

        $order = $order = $this->checkoutSession->getLastRealOrder();

        if ($order) {
            $variables['order.subtotal']        = $order->getBaseSubtotalInclTax();
            $variables['order.discount_total']  = $order->getDiscountAmount();
            $variables['order.shipping_total']  = $order->getShippingAmount();
            $variables['order.grand_total']     = $order->getBaseGrandTotal();
            $variables['order.shipping_method'] = $order->getShippingMethod();
            $variables['order.payment_method']  = $order->getPayment()->getMethod();
            $variables['order.salesrules']      = $order->getAppliedRuleIds();

            $itemId = 0;
            foreach ($order->getAllItems() as $item) {
                $variables = array_merge($variables, $this->getOrderItemVariables($item, $itemId++));
            }
        }

        return $variables;
    }
public function getVariables()
    {
        $variables = [];

        $order = $order = $this->checkoutSession->getLastRealOrder();

        if ($order) {
            $variables['order.subtotal']        = $order->getBaseSubtotalInclTax();
            $variables['order.discount_total']  = $order->getDiscountAmount();
            $variables['order.shipping_total']  = $order->getShippingAmount();
            $variables['order.grand_total']     = $order->getBaseGrandTotal();
            $variables['order.shipping_method'] = $order->getShippingMethod();
            $variables['order.payment_method']  = $order->getPayment()->getMethod();
            $variables['order.salesrules']      = $order->getAppliedRuleIds();

            $itemId = 0;
            foreach ($order->getAllItems() as $item) {
                $variables = array_merge($variables, $this->getOrderItemVariables($item, $itemId++));
            }
        }

        return $variables;
    }
public function getVariables ( ) { $ variables = [ ] ; $ order = $ order = $ this -> checkoutSession -> getLastRealOrder ( ) ; if ( $ order ) { $ variables [ 'order.subtotal' ] = $ order -> getBaseSubtotalInclTax ( ) ; $ variables [ 'order.discount_total' ] = $ order -> getDiscountAmount ( ) ; $ variables [ 'order.shipping_total' ] = $ order -> getShippingAmount ( ) ; $ variables [ 'order.grand_total' ] = $ order -> getBaseGrandTotal ( ) ; $ variables [ 'order.shipping_method' ] = $ order -> getShippingMethod ( ) ; $ variables [ 'order.payment_method' ] = $ order -> getPayment ( ) -> getMethod ( ) ; $ variables [ 'order.salesrules' ] = $ order -> getAppliedRuleIds ( ) ; $ itemId = 0 ; foreach ( $ order -> getAllItems ( ) as $ item ) { $ variables = array_merge ( $ variables , $ this -> getOrderItemVariables ( $ item , $ itemId ++ ) ) ; } } return $ variables ; }
Return order and it's item related variables

@return array
Return order and it s item related variables