25August

Virtuemart Paypal Currency Problem

Virtuemart has a multiple currency feature where users can select from a pre-defined set of currencies for checkout.

This is very useful, but has a major bug when checking out with Paypal. The final order logged in Virtuemart is correct, and has the correct currency. However, when the user is redirected to Paypal, the transaction will be done in the default currency of the Virtuemart shop.

This problem has existed since 2009, and in 2011 I would have expected it to be resolved already.

I would class this as a major problem as it results in incorrect transactions.

Forunately, the fix is relatively simple. From the Virtuemart administrator, go to List Payment Methods. Click on the Paypal item and go to the Configuration tab. Add this code to the top of the file, just after the opening php tag.

$currencysymbol = "";
if ($_SESSION['product_currency'] == "EUR" )
{
$currencysymbol = "EUR";
}
elseif ($_SESSION['product_currency'] == "GBP" )
{
$currencysymbol = "GBP";
}
else
{$currencysymbol = "USD";}

and then find the line:

"currency_code" => $_SESSION['vendor_currency'],

and change to:

"currency_code" => $currencysymbol,

Posted in Development, Tutorials

Comments (0)

Leave a comment

You are commenting as guest.

Cancel Submitting comment...

About Dave Horsfall

Dave Horsfall is a British software developer and founder of the hwdMediaShare project. More...

Recent Comments

  • Ppl like you get all the brains. I just get to say thanks for he awnesr.

    Rosa, 06. September, 2011 |

  • Ppl like you get all the brains. I just get to say thanks for he awnesr.

    Rosa, 06. September, 2011 |

  • No, the file should be called "project.properties", and it should be located in the same directory as the file called "project.xml". I'm...

    Dave Horsfall, 29. August, 2011 |

  • There is no file called "project.properties". There is a file "project.xml" is this the one? It is not "simple text" though...

    OppfinnarJocke, 29. August, 2011 |