Jump to content

Paypal and corrency rounding


mohamed23

Recommended Posts

Hello,

hope someone can help me to fix this issue.

 

Here is my problem : 

My shop is in Euro as default currency and I added US $ and UK £ currencies with rounding because it's always better to have 12$ or 12£  instead of 12.33£.

 

I set the paypal module so that the customer can pay with it's currency.

The problem is that when the customer wants to pay his order, paypal keep rounding price for the product but not for shipping costs.

 

So for example if we have in prestashop : 

10£ - product

5£ - shipping

=15£

 

In Paypal we will have this : 

10£ - product

5.10£ -shipping (which is the shipping price without rounding).

=15.10£

 

so we will have on the back office "error payment" as the amount of the order is not the same

 

 

I'm using ps 1.5.6.2 with the last version of Paypal 3.8

 

Thanks for your help

Link to comment
Share on other sites

Hey!

 

I am having the same issue. Only situation with currencies is opposite.

My shop has USD as a default currency and there are other currencies also offered.

 

I also offer free shipping when orders reach particular amount. Thus, if order is of higher amount and customer is granted for free shipping there are no issues with PayPal check-out at all and no matter what currency is in use. However, if order is of lower value and free shipping is not applied, the PayPal checkout is ok with a default currency, but not with other currencies. Because of non rounding shipping costs (as described in previous post).

 

As a result, customers get confused and since they are not sure if their order went through they normally buy somewhere else. Moreover, this is a credibility and trust destroying error.

 

Please advise.

PS is 1.6, Paypal - 3.72.

 

Regards,

Tomas

Link to comment
Share on other sites

I think the problem still exists and is really annoying. I've added a couple of new currencies and with moneybookers module there is no problem but paypal module has lots of issues with rouded currencies.

Does anyone have a solution?

Thx in advance, Trip

Link to comment
Share on other sites

  • 5 weeks later...
  • 2 months later...

It is not working in my 1.6.11. Anyone have tested the new version which is said that so many rounding issues are fixed.

The bug is old and still annoying. Atm I have one customer per day where a payment error is thrown. The skrill module runs flawless so there must be a solution.

Link to comment
Share on other sites

  • 1 month later...

Prestashop rounds to 2 decimals in all cases.

So i found a solution for this problem for PS 1.5.6.2. Just edit function getPackageShippingCost in classes/Cart.php around line 2780 (almost at the end of function) from

$shipping_cost = (float)Tools::ps_round((float)$shipping_cost, 2);

to 

$shipping_cost = (float)Tools::ps_round((float)$shipping_cost, (Currency::getCurrencyInstance((int)$this->id_currency)->decimals * _PS_PRICE_DISPLAY_PRECISION_));
Link to comment
Share on other sites

Hi Peky, the line

$shipping_cost = (float)Tools::ps_round((float)$shipping_cost, 2);

is still the same so if your code really elimintes the problem this would be really great and if you have the time you can add it to github here https://github.com/PrestaShop/PrestaShop/blob/1.6/classes/Cart.php so other people can benefit from that in the future. I will try it asap.

Thank you, Trip 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...