Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Please help, installed Switch between Inc / Ex vat and vat is still being added onto ex vat orders.


busymum

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...