Hello,
I am using 2Checkout as one of my payment mode, my store uses two currencies Pakistani Rupee and United Arab Emirate Dirham. Whenever a client make purchase and chooses 2CO as payment mode it redirects to 2CO payment page where it shows the same order total amount in USD.
Now what I want is that when a user choose 2CO payment mode the store should convert the order total (i.e PKR or AED) in to USD on current conversion rates and then it takes to 2CO payment page.
Await for help.
Thanks.
The total passed in must match total saved for the order in OpenCart. So you could accomplish this by setting your default currency to USD in OpenCart, Set your other currencies and set their peg rates. Then around line 11 on /catalog/controller/payment/twocheckout.php, replace:
with
This will stop the currency conversion from occurring on the total and will insure that the amount matches when OpenCart validates the passback.
Let me know if you need any help with implementing this.
Code: Select all
$this->data['total'] = $this->currency->format($order_info['total'], $order_info['currency_code'], $order_info['currency_value'], false);
Code: Select all
$this->data['total'] = number_format($order_info['total'], 2, '.', '');
Let me know if you need any help with implementing this.
The easy way is to edit
catalog/view/theme/default/template/payment/twocheckout.tpl
and add this line
<input type="text" name="currency_code" value="<?php echo $currency_code; ?>" />
under
<input type="text" name="ship_country" value="<?php echo $ship_country; ?>" />
catalog/view/theme/default/template/payment/twocheckout.tpl
and add this line
<input type="text" name="currency_code" value="<?php echo $currency_code; ?>" />
under
<input type="text" name="ship_country" value="<?php echo $ship_country; ?>" />
Who is online
Users browsing this forum: No registered users and 6 guests