title: Get order fee and discount amounts for order totals calculations in WooCommerce
body: <p>Based of <a href="https://stackoverflow.com/questions/69203103/calculate-fee-from-cart-totals-subtotal-shipping-without-adding-it-to-order/">Calculate fee from cart totals (subtotal + shipping) without adding it to order total value in Woocommerce</a></p>
  <p>I know how to get cart totals. Fees and discounts are included in the calculation.</p>
  <pre><code>// Get cart subtotal &amp; shipping total &amp; fees &amp; discounts
      
  $subtotal                = WC()-&gt;cart-&gt;subtotal;
  $shipping_total          = WC()-&gt;cart-&gt;get_shipping_total();
  $fees                    = WC()-&gt;cart-&gt;get_fee_total();
  $discount_excl_tax_total = WC()-&gt;cart-&gt;get_cart_discount_total();
  $discount_tax_total      = WC()-&gt;cart-&gt;get_cart_discount_tax_total();
  
  $discount_total          = $discount_excl_tax_total + $discount_tax_total;
  
  // Cart Total
  $cart_total = $subtotal + $shipping_total + $fees - $discount_total;
  </code></pre>
  <p>I need to get order totals also. I have a problem getting order discounts and fees.</p>
  <pre><code>function filter_woocommerce_get_order_item_totals( $order ) {    
      
  // Get order subtotal &amp; shipping total &amp; fees &amp; discounts
  
  $order_subtotal              = $order-&gt;get_subtotal();
  $order_shipping_total        = $order-&gt;get_shipping_total();
  $order_fees                  = ...
  $order_discounts             = ...
  
  // Order Total
  $order_total = $order_subtotal + $order_shipping_total + $order_fees - $order_discounts;
  </code></pre>
  <p>Order totals will be displayed on the order-received / thank-you page.</p>
  <p><strong>How can I get order fees and discount amounts for order totals calculation?</strong></p>
  <p>Below code does not seem to be the right answer:</p>
  <pre><code>$order_fees       = $order-&gt;get_fees();
  $order_discounts  = $order-&gt;get_discount_total();
  </code></pre>