Magento Forum

   
Page 2 of 5
1.6.0.0 price rounding issues, wrong price displayed on grid and product view
 
Roeltje
Jr. Member
 
Total Posts:  19
Joined:  2009-01-19
Waalwijk, Netherlands
 

Lines 493/494 (typo in 439...)
Doesnt work here…

 
Magento Community Magento Community
Magento Community
Magento Community
 
STEP_Software
Jr. Member
 
Total Posts:  22
Joined:  2009-01-27
 

We had the same problem and use this fix. - Thanks!

Additional we have the problem with wrong subtotal when more than one product in cart (same settings with 19% tax...): e.g

product-price: 50 Eur, 2 pieces in cart -> subtotal is 99,99 Eur !

 
Magento Community Magento Community
Magento Community
Magento Community
 
nspacex
Jr. Member
 
Total Posts:  4
Joined:  2011-02-02
EDDN
 

Hi,

i had the same problem. i solved this with the following simple change:

app/local/Mage/Core/Model/Store.php, function roundPrice(), Line: ~805

return round($price4);

regards,

 
Magento Community Magento Community
Magento Community
Magento Community
 
STEP_Software
Jr. Member
 
Total Posts:  22
Joined:  2009-01-27
 
nspacex - 12 October 2011 11:22 AM

Hi,
i had the same problem. i solved this with the following simple change:
app/local/Mage/Core/Model/Store.php, function roundPrice(), Line: ~805

return round($price4);

I found the Store.php in /app/code/core/Mage/Core/Model and changed the code but im my case it did not work.

 
Magento Community Magento Community
Magento Community
Magento Community
 
nspacex
Jr. Member
 
Total Posts:  4
Joined:  2011-02-02
EDDN
 

Hi,

hmm ... In my case it works on the product pages as well as on the checkout page. I installed MarektReadyGermany and the fix (mentioned above) ... and it works. Maybe i will try to reproduce it with a clean installation (without any extension) tonight

regards,

 
Magento Community Magento Community
Magento Community
Magento Community
 
mattlecount
Jr. Member
 
Avatar
Total Posts:  6
Joined:  2009-05-19
 

krzaczek fix worked for me.

 
Magento Community Magento Community
Magento Community
Magento Community
 
isegkos
Jr. Member
 
Total Posts:  2
Joined:  2011-05-10
 

http://www.magentocommerce.com/bug-tracking/issue/?issue=12616

 
Magento Community Magento Community
Magento Community
Magento Community
 
skekum
Jr. Member
 
Total Posts:  5
Joined:  2010-07-29
 

I went to:

app/code/core/Mage/Tax/Model/Calculation.php Line 466

and changed:
FROM

public function calcTaxAmount($price$taxRate$priceIncludeTax=false$round=true)

TO

public function calcTaxAmount($price$taxRate$priceIncludeTax=false$round=false)

I\’m using 1.6.0 and it worked for me.

 
Magento Community Magento Community
Magento Community
Magento Community
 
ScottG
Member
 
Total Posts:  45
Joined:  2011-07-13
 

I though I might just throw in my 2c worth here (including tax)

A cart set to ‘prices include tax’ in admin will cause rounding errors. Eg, an item set to $19 including tax will show on the front end as $19.01 (it depends on your tax rate of course)

The solution by nspacex to change the rounding to 4 does work for the front end but will throw errors with PayPal:

“ PayPal gateway has rejected request. The totals of the cart item amounts do not match order amounts (#10413: Transaction refused because of an invalid argument. See additional error messages for details). “

I think this is because the data passed to PayPal is 1 or 2c different and PayPal rejects the transaction.

The solution by skekum:

public function calcTaxAmount($price, $taxRate, $priceIncludeTax=false, $round=false)

seems to work for PayPal, I have tried several transactions and this solution both displays on the front end as (eg) $19.00 and PayPal accept the transaction request.

I have only done some very quick tests but if any further issues arise I will post back here.

BR

 
Magento Community Magento Community
Magento Community
Magento Community
 
g_gr
Jr. Member
 
Total Posts:  1
Joined:  2010-01-21
 

Hey

I didn’t want to mess with the core code. So, I just took a look at the price template file (/app/design/frontend/base/default/template/catalog/product/price.phtml). In the shopping cart and in the checkout process the prices seem to be fine. The same seems to be true for when both the including and the excluding prices are show in the catalog/product view.

When both prices are shown, the code refers to the $_finalPriceInclTax variable whereas the single price version uses $_price.
Therefore, I copied the base file to my custom theme and changed the corresponding variable. In my case it was line 109 (price including tax - no weee etc.) and so far it seems to work fine.

/* /app/design/frontend/[my_theme]/default/template/catalog/product/price.phtml */
<?php echo $_coreHelper->currency($_price,true,true?> // LINE 109 (OLD)
<?php echo $_coreHelper->currency($_finalPriceInclTax,true,true?> // LINE 109 (NEW)

I know that this does not solve the underlying problem and I’m unfortunately not very familiar with the Magento core code either but I hope it’s a quite decent alternative.

Cheers!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Lrrr
Jr. Member
 
Total Posts:  6
Joined:  2009-07-27
 
ScottG - 28 November 2011 04:19 PM

[...]
The solution by nspacex to change the rounding to 4 does work for the front end but will throw errors with PayPal:

“ PayPal gateway has rejected request. The totals of the cart item amounts do not match order amounts (#10413: Transaction refused because of an invalid argument. See additional error messages for details). “
[...]

In my case, with Magento 1.6.1.0, it did work using this method. I successfully placed an order using PayPal and containing products which made trouble before changing the rounding.

 
Magento Community Magento Community
Magento Community
Magento Community
 
dk_mbx
Jr. Member
 
Total Posts:  19
Joined:  2011-02-13
 
Lrrr - 20 December 2011 06:57 AM

ScottG - 28 November 2011 04:19 PM

[...]
The solution by nspacex to change the rounding to 4 does work for the front end but will throw errors with PayPal:

“ PayPal gateway has rejected request. The totals of the cart item amounts do not match order amounts (#10413: Transaction refused because of an invalid argument. See additional error messages for details). “
[...]

In my case, with Magento 1.6.1.0, it did work using this method. I successfully placed an order using PayPal and containing products which made trouble before changing the rounding.

No! I agree with ScottG and his effects when using the rounding-4-fix which is described often. I’ve tested several orders and figured out that the round 4 affected in most cases an error… better said all my paypal-error-orders getting fixed when I removed the round-4-fix. All other orders still runs well as before.

 
Magento Community Magento Community
Magento Community
Magento Community
 
dk_mbx
Jr. Member
 
Total Posts:  19
Joined:  2011-02-13
 
skekum - 24 November 2011 06:47 PM

I went to:

app/code/core/Mage/Tax/Model/Calculation.php Line 466

and changed:
FROM

public function calcTaxAmount($price$taxRate$priceIncludeTax=false$round=true)

TO
public function calcTaxAmount($price$taxRate$priceIncludeTax=false$round=false)

I\’m using 1.6.0 and it worked for me.

Thanks. This is the only Bugifx which worked in all cases for me. The FE-price is now displayed correctly and the taxes in checkout are calculated right. So paypal has no problem with fraud attacks agains.

Thanks smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
moncif
Jr. Member
 
Total Posts:  8
Joined:  2010-04-30
 

We have found the same solution as above indeed. But we did not touch the core files. Instead we extend the tax calculation class. I ve added a module (with explanation) that will fix the problem.

File Attachments
Experius_Taxextended.zip  (File Size: 17KB - Downloads: 419)
 
Magento Community Magento Community
Magento Community
Magento Community
 
Zeramico
Jr. Member
 
Total Posts:  3
Joined:  2010-11-02
 

Hello everyone,
I tried the solution of \"moncif\", but I couldn\’t understend how to work it, you can tell me more?

This problem is also present in version 1.6.2 for me…

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
Page 2 of 5