Hello!
Strange question maybe, but I can't seem to solve this myself so I'm reaching out for help from any of the kind souls lurking around this forum :).
I'm based in Sweden but have a lot of Brazilian customers, so I want to offer them the Brazilian payment method "PagSeguro" (big thing in Brazil apparently).
There is a free plugin for VM3 made already that works great except for one thing - the total being sent to PagSeguro is in my shop currency and not Brazilian Real. So, if my product has a price of 100 "Swedish Krona" Pagseguro thinks that's worth 100 Brazilian Real which certainly not is the case :).
I assume I have to tell the plugin somehow to convert all amounts to BRL before sending any totals of to the Pagseguro site, and I'm also going to assume that it's quite easy to fix this as long as you've got a higher level of skills than me :).
The project is thankfully on github so if anyone is up for helping a fellow out here I would truly appreciate it :
https://github.com/luizwbr/PagSeguro-VirtueMart-3/blob/master/pagseguro_virtuemartbrasil.php
Million thanks in advance!
Best regards
Peter
this bit u should be looking into:
if (!class_exists('VirtueMartModelOrders'))
require( JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'orders.php' );
$this->getPaymentCurrency($method);
// END printing out HTML Form code (Payment Extra Info)
$q = 'SELECT `currency_code_3` FROM `#__virtuemart_currencies` WHERE `virtuemart_currency_id`="' . $method->payment_currency . '" ';
$db = &JFactory::getDBO();
$db->setQuery($q);
$currency_code_3 = $db->loadResult();
$paymentCurrency = CurrencyDisplay::getInstance($method->payment_currency);
$totalInPaymentCurrency = round($paymentCurrency->convertCurrencyTo($method->payment_currency, $order['details']['BT']->order_total, false), 2);
$cd = CurrencyDisplay::getInstance($cart->pricesCurrency);