Author Topic: Serious bug when using currency converter  (Read 12181 times)

techmatters

  • Beginner
  • *
  • Posts: 10
    • Web Designer Melbourne
Serious bug when using currency converter
« on: August 18, 2008, 15:00:15 pm »
There are two major bugs that we have uncovered when you are using the currency converter that affects Paypal and shipping.

Paypal:
VM sends the converted order total amount to Paypal but sends the shop's base currency code, resulting in a mismatch between the order total amount and the currency.  Say the cost of the item was 10 Euro (in the shop/vendor currency) and when converted that is USD 14.70. VM passes 14.70 to Paypal but says the currency is Euro when it should be USD.

Here is the fix:

In the "Configuration" tab of the PayPal module ("Store > List Payment Profiles > "PayPal"), "Payment extra info" change the below code:

Code: [Select]
"currency_code" => $_SESSION['vendor_currency'],
To this:

Code: [Select]
"currency_code" => $_SESSION['product_currency'],
The next problem is also very serious.
VM is "converting" the shipping costs again AFTER the order is confirmed. This affects the amount of shipping in the order totals, either increasing or decreasing the amount a second time by the conversion ratio. All looks OK on the confirm page, but once the order is placed, the shipping amount is wrong, and this also affects the amount passed to any payment processor as this adjusted shipping rate is also passed to the payment module.

We are using the Standard Shipping Module - if you are using a different shipping module test to ensure our suggested fix works for your configuration.

Here is our fix:

In line 1598 of the file "administrator/components/com_virtuemart/classes/ps_checkout.php", comment out the below lines:

Code: [Select]
$d['shipping_tax'] = $GLOBALS['CURRENCY']->convert( $d['shipping_tax'] );
$d['shipping_total'] = $GLOBALS['CURRENCY']->convert( $d['shipping_total']);


This caused us considerable pain. Hope it helps someone.
Joomla! 1.5.11, VirtueMart 1.1.3 stable

arnold82

  • Beginner
  • *
  • Posts: 6
Re: Serious bug when using currency converter
« Reply #1 on: August 18, 2008, 22:38:05 pm »
THANK YOU!!!!!!! LOL just what was causing me pain in the ass.

sundar

  • Beginner
  • *
  • Posts: 6
Re: Serious bug when using currency converter
« Reply #2 on: October 21, 2008, 16:07:43 pm »
wow great work sir thx for this information tested by me for indian currency but its not working properly am getting the same amount of indian rupee as a indian dollar in paypal its not converting from indian rupee to us dollar in paypal wats wrong?

sundar

  • Beginner
  • *
  • Posts: 6
Re: Serious bug when using currency converter
« Reply #3 on: October 30, 2008, 16:16:49 pm »
any solution is possible to convert indian rupee to US $ after check out?

crashtackle

  • Beginner
  • *
  • Posts: 29
Re: Serious bug when using currency converter
« Reply #4 on: November 18, 2008, 07:12:55 am »
seems to do the same thing on my credit card payment gateway.

We accept payment in South African Rand... currency conversions converts to foreign currency (Aus dollars for example) and sends that result through as South African rands...seriously dodgy

Some buying R1000 worth of products and using the currency convert to see it in dollars is only billed R150!!!

It could put someone out of business.

SnakeDragon

  • Jr. Member
  • **
  • Posts: 61
Re: Serious bug when using currency converter
« Reply #5 on: December 07, 2008, 22:11:04 pm »
Thank you very, very much!! :D

CovLee

  • Beginner
  • *
  • Posts: 22
Re: Serious bug when using currency converter
« Reply #6 on: January 20, 2010, 14:37:37 pm »
I change those 2 lines into: (Comment Out)

/*$d['shipping_tax'] = $GLOBALS['CURRENCY']->convert( $d['shipping_tax'] );
$d['shipping_total'] = $GLOBALS['CURRENCY']->convert( $d['shipping_total'] );*/

And the bug still exsist :(

CovLee

  • Beginner
  • *
  • Posts: 22
Re: Serious bug when using currency converter
« Reply #7 on: January 23, 2010, 09:29:11 am »
I change those 2 lines into: (Comment Out)

/*$d['shipping_tax'] = $GLOBALS['CURRENCY']->convert( $d['shipping_tax'] );
$d['shipping_total'] = $GLOBALS['CURRENCY']->convert( $d['shipping_total'] );*/

And the bug still exsist Sad

bigheadmall

  • Beginner
  • *
  • Posts: 7
    • BigheadMall Online Shopping
Re: Serious bug when using currency converter
« Reply #8 on: January 25, 2010, 09:32:05 am »
Thank you  I find a long time
http://www.bigheadmall.com  Shopping Online
http://www.bigheadmall.us buy blackberry online
http://www.nextrix.com Software & Website for Business

Reincha

  • Jr. Member
  • **
  • Posts: 137
Re: Serious bug when using currency converter
« Reply #9 on: July 20, 2011, 14:50:13 pm »
This works even today with Virtuemart 1.1.9 !!!

dac3d

  • Beginner
  • *
  • Posts: 36
Re: Serious bug when using currency converter
« Reply #10 on: August 08, 2011, 18:02:50 pm »
this doesent work for me, i comment out but nothing hapens   :-\

any other idea?

bladerz

  • Beginner
  • *
  • Posts: 13
Re: Serious bug when using currency converter
« Reply #11 on: September 09, 2011, 19:37:46 pm »
Thank you !!!  :D

loppan

  • Jr. Member
  • **
  • Posts: 132
    • CRASHDÏET Official Website
Re: Serious bug when using currency converter
« Reply #12 on: October 07, 2011, 20:42:13 pm »
Wow, thank you techmatters ! ! !

I've had sooo much problems with multiple currencies on vm 1.1.8, and when I finally managed to get the correct shipping cost shown at checkout AND also being sent to paypal, I noticed that the order confirmation e-mails, and what was being sent to the database, was once again, the wrong shipping cost (converted twice).

The fix by techmatters fixed my order confirmation e-mails (as well as what's in the database of course) so now everything works for me, finally.

I list all the solutions I found that worked for me in this post, feel free to check it out :

http://forum.virtuemart.net/index.php?topic=90024.msg299730#msg299730