Thursday, November 11, 2010

PrestaShop Tips - Paypal payment module currency conversion issue and customer selected currency issue

What is the problem


If you are using Paypal payment module ver 1.7 at PrestaShop 1.3.2, you will find some issue if you are using more than one currencies.

First, you will need to understand following concepts in PrestaShop
1. Default currency (assume set as: USD)
2. Paypal restricted currency( assume set as Euro)
3. Your store support currencies (assume you set as USD, EURO, GBP,....)

If you want know more about what is "Default currency", " Paypal restricted currency", please see my another post here

Issue/Problem 1: Currency Converting Problem
If customer select currency (e.g. GBP) other than Paypal Restriction Currency (Euro), when customer start checkout, PrestaShop will redirect to Paypal without converting, it means customer will be charged with Euro by the amount of GBP.

Issue/Problem 2: Customer selected currency
At Paypal payment page, if customer cancel payment and click "Return To Store" (your PrestaShop Store). When customer comes back to your store, all prices of products and shopping cart are displayed as Erro instead of customer selected GBP.


Affected PrestaShop versions


This issue 1 seem only happens on Paypal 1.7 which comes with PrestaShop 1.3.2
The issue 2 seems happens in both Paypal 1.7 and 1.6 which comes with PrestaShop 1.3.1

The solution


To fix issue 1, some more coding is required than fixing issue 2.
I will explained in detail on how to fix issue 2 here.

In the payment module "Agile Paypal", both issues are fixed. "Agile Paypal" is a Express Checkout module that allows customer checkout without sign up to registration or log in.

For more information this module Please Visit Here
If you interested in buying, Please Visit Here.
Or you can have live demo at below sites:
http://ecochoiceshop.com/ (public service)
http://expresscheckout.dyndns.org:8080/demoshop/ (sand box test)

Now, let me show you on how to fix issue 2:
Please apply following two changes to file ./modules/paypal/redirect.php
1. Add following code at position as indicated in the screen shot image below it.


$customercurrency = $cookie->id_currency;



2. Add following code before the end of script as indicated by the screen shot below.


$cookie->id_currency = $customercurrency;



Note:
The above change is for module Paypal 1.7 which comes with PrestaShop 1.3.2
But it should be the similar for other version like module Paypal 16.

8 comments:

Marcus said...

Work for me. Thanks!

P said...

Hi

This works well thanks, however the order details, history details are all in the paypal restricted currency and not in the default currency or customer currency. This is causing some problem for me as my customers see their invoices in the paypal currency which isn't feasible for us. Is there any fix for this?

Thanks

Alvin said...

Thanks for your comment.

Yes, I also noticed this problem. It will require changes in the invoice module, not in payment and requires some more coding. I am thinking of create an add on module for this function. Please come visit again soon or visit http://prestashop-addons.com/ for update.

Rocco said...

Hi,

I know it's a pretty old thread, but I am having the same problem (dollars shown on website when canceling paypal payment) with PayPal in PS 1.4.5.1 and just don't know how to solve it. The file ./modules/paypal/redirect.php does not seem to exist in this version. Is there a workaround you have heard of? I would greatly appreciate it!

Alvin said...

The file ./modules/paypal/redirect.php does not seem to exist in this version. Is there a workaround you have heard of? I would greatly appreciate

should be able to find it under following folder

./modules/paypal/standard/redirect.php

Anonymous said...

I'm having the same issue 1 using Gspay to accept payment.
my default currency is euro but Gspay account is USD, and when checkout in euro the same amount is checked out in USD on Gspay.
Is there any code I should use from paypal module to fix this on my Gspay module?
Thanks.
PS 1.4.6.2

Rocco said...

Sorry, need to get my eyes checked... :) Anyway thanks for helping to fix a huge problem!! Your blog has really been a help so far, me being a PS novice...

Alvin said...

glad to know you have your problem solved.