title: How to calculate line total in woocommerce
body: <p>How can I calculate the line total for creating order in woo commerce if i am using coupon code of 20 rs off and and having tax of 6%.</p>
  
  <pre><code>$order = new WC_Order();
  $order = wc_create_order($order_data);
  
  $items = WC()-&gt;cart-&gt;get_cart();
  
  foreach($items as $item =&gt; $values) {
      $product_id = $values['product_id'];
      $product = wc_get_product($product_id);
      $quantity = (int)$values['quantity'];
  
      $sale_price = $product-&gt;get_price();
      $final_price =  ?????
      $price_params = array( 'totals' =&gt; array( 'subtotal' =&gt; $sale_price, 'total' =&gt; $final_price ) );
      $order-&gt;add_product($product, $quantity,$price_params);
  }
  </code></pre>
  
  <p>Here how can I get $final_price ?</p>