CuteDevil84 Posted July 6, 2009 Posted July 6, 2009 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 Quote
Guest Posted August 4, 2009 Posted August 4, 2009 (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 August 4, 2009 by gkittell Quote
surfac Posted August 5, 2009 Posted August 5, 2009 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 Quote
Guest Posted August 5, 2009 Posted August 5, 2009 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.... Quote
Guest Posted August 5, 2009 Posted August 5, 2009 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.... Quote
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.