Forums / General Questions / Tax only applying to first product in cart?

Tax only applying to first product in cart?

Views: 364

Results 1 to 1 of 1
14 Nov 2011, 3:41 PM
#1
buffalokatz avatar

buffalokatz

New Zenner

Join Date:
Nov 2011
Posts:
2
Plugin Contributions:
0

Tax only applying to first product in cart?

Hi All,
Tax is only calculating on the first product in my cart. I can't get it to see the subtotal and calculate on that. Here is my order.php in the tax code:

  /*********************************************
   * Calculate taxes for this product
   *********************************************/
  $shown_price = (zen_add_tax($this->products[$index]['final_price'], $this->products[$index]['tax']) * $this->products[$index]['qty'])
  + zen_add_tax($this->products[$index]['onetime_charges'], $this->products[$index]['tax']);
  $this->info['subtotal'] += $shown_price;

  // find product's tax rate and description
  $products_tax = $this->products[$index]['tax'];
  $products_tax_description = $this->products[$index]['tax_description'];

  if (DISPLAY_PRICE_WITH_TAX == 'true') {
    // calculate the amount of tax "inc"luded in price (used if tax-in pricing is enabled)
    $tax_add = $shown_price - ($shown_price / (($products_tax < 10) ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax)));
  } else {
    // calculate the amount of tax for this product (assuming tax is NOT included in the price)
    $tax_add = $products_tax / 100 * $shown_price;
  }
  $this->info['tax'] += $tax_add;
  if (isset($this->info['tax_groups'][$products_tax_description])) {
    $this->info['tax_groups'][$products_tax_description] += $tax_add;
  } else {
    $this->info['tax_groups'][$products_tax_description] = $tax_add;
  }
  /*********************************************
   * END: Calculate taxes for this product
   *********************************************/