更新跟踪代码 $order_total wordpress woocommerce

Updating tracking code $order_total wordpress woocommerce

我正在尝试让这个订单跟踪正常工作,除了 $order_total

    <!-- Image Pixel Tracking - Mandatory -->
   <img src="https://www.awin1.com/sread.img?tt=ns&tv=2&merchant=xxxx&amount=<?php echo $order_total ?>&cr=GBP&ref=<?php echo $order_id; ?>&parts=DEFAULT:<?php echo $order_total ?>&vc=<?php echo $order_coupon ?>&ch=AW&testmode=0" border="0" width="0" height="0">


   <!-- Javascript Tracking - Mandatory --> 
   <script type="text/javascript">
   //<![CDATA[ 

   /*** Do not change ***/
   var AWIN = {};
   AWIN.Tracking = {};
   AWIN.Tracking.Sale = {};

   /*** Set your transaction parameters ***/
   AWIN.Tracking.Sale.amount = '<?php echo $order_total; ?>';
   AWIN.Tracking.Sale.orderRef = '<?php echo $order_id; ?>';
   AWIN.Tracking.Sale.parts = 'DEFAULT:<?php echo $order_total; ?>';
   AWIN.Tracking.Sale.voucher = '<?php echo $order_coupon; ?>';
   AWIN.Tracking.Sale.currency = 'GBP';
    AWIN.Tracking.Sale.test = '0';
    AWIN.Tracking.Sale.channel = 'AW';
    //]]>
    </script>

我得到了订单总额,但我需要它来取消任何折扣和运费我已经尝试这样做

     $order_total_without_discount = number_format($order->get_subtotal(), 2, ".", "");


    $cart_discount = $woocommerce->cart->discount_total;

    $cart_discount_decimal = number_format($cart_discount, 2, ".", "");  

   $order_total = $order_total_without_discount - $cart_discount_decimal;


    $order_total_with_shipping = number_format($order->get_total(), 2, ".", "");

这是行不通的,希望有人能提供帮助。

我已经回到跟踪公司,他们提供零支持。

这已通过更改

解决
 $order_total_without_discount = number_format($order->get_subtotal(), 2, ".", "");

 $order_total_without_discount = number_format($order->get_total(), 2, ".", "");