Site icon Hip-Hop Website Design and Development

Woocommerce line_total vs line_subtotal? [closed]

What is the distinction between a cart merchandise’s line_total vs line_subtotal? It appears neither keep in mind taxes.

I am making an attempt to calculate the price of every line merchandise (eg: Product A prices $40, if amount = 2, then I wish to get $80).

That is the information I get from a dummy cart merchandise:

[
["key"]=>
  string(32) "c20ad4d76fe97759aa27a0c99bff6710"
  ["product_id"]=>
  int(12)
  ["variation_id"]=>
  int(0)
  ["variation"]=>
  array(0) {
  }
  ["quantity"]=>
  int(2)
  ["data_hash"]=>
  string(32) "b5c1d5ca8bae6d4896cf1807cdf763f0"
  ["line_tax_data"]=>
  array(2) {
    ["subtotal"]=>
    array(1) {
      [1]=>
      float(8)
    }
    ["total"]=>
    array(1) {
      [1]=>
      float(8)
    }
  }
  ["line_subtotal"]=>
  float(80)
  ["line_subtotal_tax"]=>
  float(8)
  ["line_total"]=>
  float(80)
  ["line_tax"]=>
  float(8)

]

Discover how each line_subtotal and line_total are the very same regardless of having $8 in taxes, so what is the distinction? Are they interchangeable? Ought to I exploit line_total or line_subtotal?