News:

Looking for documentation? Take a look on our wiki

Main Menu

Error in core file for klarna? klarnahandler.php

Started by ceitean, July 31, 2013, 22:16:41 PM

Previous topic - Next topic

ceitean

Hello,
There seems to be an error in the klarnahandler.php file for the klarna payments plugin. This occurs only when handling discounts.
..www\dsite\plugins\vmpayment\klarna\klarna\helpers\
around line 442 the following does not pick up the correct price:
$price = $basePriceWithTax = !empty($item->basePriceWithTax) ? $item->basePriceWithTax : $item->product_final_price;

it seems as the $basePriceWithTax is always zero and the product_final_price is picked which will lead to calculation of discounts erroneously. 

i replaced it with this line and its is better but not perfect since there are small rounding errors.
$price = $item->product_final_price + $item->product_subtotal_discount;

The best would be if the system uses the product_basePriceWithTax correctly.

Does anybody have a better solution for this?
Regards,
andrew,

Tested on Virtuemart 2.0.22a and Joomla! 2.5.11