Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

Hi,

 

I have installed one page checkout and everything works fine, except the tax is not wright.

it doubles up the tax, so when its normally $1 tax now it says $2.

In the admin section when i'm adding product everything is fine.

 

Does anyone have an idea on how to fix this?

 

thx

  • 4 weeks later...
Posted (edited)
Hi,

 

I have installed one page checkout and everything works fine, except the tax is not wright.

it doubles up the tax, so when its normally $1 tax now it says $2.

In the admin section when i'm adding product everything is fine.

 

Does anyone have an idea on how to fix this?

 

thx

 

same problem for me. good contribution but wish i had waited until more bugs worked out. especially not happy with broken language structure!!

 

here is what i changed. it seems to work but use at your own caution:

 

in includes/classess/onepage_checkout.php at or around lines 132:

 

change from:

 

if (DISPLAY_PRICE_WITH_TAX == 'true'){

$order->info['tax'] += $shown_price - ($shown_price / (($products_tax < 10) ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax)));

if (isset($order->info['tax_groups']["$products_tax_description"])) {

$order->info['tax_groups']["$products_tax_description"] += $shown_price - ($shown_price / (($products_tax < 10) ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax)));

}else{

$order->info['tax_groups']["$products_tax_description"] = $shown_price - ($shown_price / (($products_tax < 10) ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax)));

}

}else{

$order->info['tax'] += ($products_tax / 100) * $shown_price;

if (isset($order->info['tax_groups']["$products_tax_description"])) {

$order->info['tax_groups']["$products_tax_description"] += ($products_tax / 100) * $shown_price;

}else{

$order->info['tax_groups']["$products_tax_description"] = ($products_tax / 100) * $shown_price;

}

}

}

 

to:

 

if (DISPLAY_PRICE_WITH_TAX == 'true'){

//$order->info['tax'] += $shown_price - ($shown_price / (($products_tax < 10) ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax)));

if (isset($order->info['tax_groups']["$products_tax_description"])) {

// $order->info['tax_groups']["$products_tax_description"] += $shown_price - ($shown_price / (($products_tax < 10) ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax)));

}else{

$order->info['tax_groups']["$products_tax_description"] = $shown_price - ($shown_price / (($products_tax < 10) ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax)));

}

}else{

//$order->info['tax'] += ($products_tax / 100) * $shown_price;

if (isset($order->info['tax_groups']["$products_tax_description"])) {

// $order->info['tax_groups']["$products_tax_description"] += ($products_tax / 100) * $shown_price;

}else{

$order->info['tax_groups']["$products_tax_description"] = ($products_tax / 100) * $shown_price;

}

}

}

 

i have simply commented out 2 lines. i think the nesting logic statements were doing the calculation twice. i am NOT an expert so, back up and test and test and test.

 

good luck!

 

Gregg

Edited by gkittell
Posted

Hi,

 

I had the same problem and just solved it. Here is how I did it:

 

Try changing file onepage_checkout.php - function fixTaxes().

 

Search for this code:

 

$products = $cart->get_products();

if (sizeof($products) > 0){

$order->info['subtotal'] = 0;

for ($i=0, $n=sizeof($products); $i<$n; $i++) {

 

You have to add one line:

 

$products = $cart->get_products();

if (sizeof($products) > 0){

$order->info['subtotal'] = 0;

$order->info['tax_groups'] = '';

for ($i=0, $n=sizeof($products); $i<$n; $i++) {

 

Hope it works for you.

 

 

Hi,

 

I have installed one page checkout and everything works fine, except the tax is not wright.

it doubles up the tax, so when its normally $1 tax now it says $2.

In the admin section when i'm adding product everything is fine.

 

Does anyone have an idea on how to fix this?

 

thx

Posted
Hi,

 

I had the same problem and just solved it. Here is how I did it:

 

Try changing file onepage_checkout.php - function fixTaxes().

 

Search for this code:

 

$products = $cart->get_products();

if (sizeof($products) > 0){

$order->info['subtotal'] = 0;

for ($i=0, $n=sizeof($products); $i<$n; $i++) {

 

You have to add one line:

 

$products = $cart->get_products();

if (sizeof($products) > 0){

$order->info['subtotal'] = 0;

$order->info['tax_groups'] = '';

for ($i=0, $n=sizeof($products); $i<$n; $i++) {

 

Hope it works for you.

 

thanks for the suggestion. it works for showing the correct tax amount on the order but the TOTAL for checkout is still twice what it should be....

Posted
thanks for the suggestion. it works for showing the correct tax amount on the order but the TOTAL for checkout is still twice what it should be....

 

now the two changes, yours and mine, seems to work ok. however, that is without extensive testing.

 

frankly, this contribution has good potential but has been done sloppily. many errors and too many broken structures. they really should have tested more. having said that, i am invested in this contribution already and probably won't roll it back....

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.

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...