busymum Posted August 21, 2006 Share Posted August 21, 2006 I have installed the Switch between Inc and Ex TAX v1_RC2a contrib and it works fine when customers order inc vat. However if they order Ex vat., at the end of the checkout, the total mysteriously adds on the vat anyway. I've looked thru all files and compared to another site that uses the contrib and works fine and everything looks fine. I've also looked at order_totals.php and that seems OK too. Please help, what could be wrong? Thank you. Quote Link to comment Share on other sites More sharing options...
busymum Posted August 23, 2006 Author Share Posted August 23, 2006 I have installed the Switch between Inc and Ex TAX v1_RC2a contrib and it works fine when customers order inc vat. However if they order Ex vat., at the end of the checkout, the total mysteriously adds on the vat anyway. I've looked thru all files and compared to another site that uses the contrib and works fine and everything looks fine. I've also looked at order_totals.php and that seems OK too. Please help, what could be wrong? Thank you. OK, I've found this, problems are all in /includes/classes/order.php The culprit code is in one place in particular global $vat_disp; if ($vat_disp == '1') { $this->info['total'] = $this->info['subtotal'] + $this->info['shipping_cost']; } else { $this->info['total'] = $this->info['subtotal'] + $this->info['tax'] + $this->info['shipping_cost']; } Which looks simple enough if the vat_disp is set to 1 then it makes the order total by not adding the tax? however printing out the results show the subtotal has tax already added at this stage? which takes me to the line with this on $shown_price = tep_add_tax($this->products[$index]['final_price'], $this->products[$index]['tax']) * $this->products[$index]['qty']; $this->info['subtotal'] += $shown_price; Which adds the tax to the shown price and then adds that to the subtotal!!! No matter what! I?ve tried editing it ? putting in an if statement etc? and I just either get it with tax or zero! Which doesn?t help either. I've tried replacing this with the original code, some code from another site that works exactly the same way with the contrib and nothing is fixing it. Something thats changed in the logic I think in the last couple of updates which has secured the ordering code from tampering. What's shall I do to fix this when it looks like it can't be fixed? Thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.