Post by ahsankaberali » Wed Jul 18, 2012 5:05 pm

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.

Newbie

Posts

Joined
Wed Jul 18, 2012 5:00 pm

Post by undeadzed » Thu Jul 19, 2012 6:45 am

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:

Code: Select all

$this->data['total'] = $this->currency->format($order_info['total'], $order_info['currency_code'], $order_info['currency_value'], false);
with

Code: Select all

$this->data['total'] = number_format($order_info['total'], 2, '.', '');
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.

Newbie

Posts

Joined
Sun Dec 05, 2010 2:54 am

Post by 10000000 » Tue Aug 27, 2013 4:10 am

pleas help.
I have similar problem. 2 currencies EUR and USD. I have order 22.00 EUR in my store, but In 2CO control panel 22.00 USD

Please share some code to fix it.
Thanks!

Newbie

Posts

Joined
Sun Jun 17, 2012 9:01 am

Post by 10000000 » Fri Oct 18, 2013 6:14 am


Newbie

Posts

Joined
Sun Jun 17, 2012 9:01 am

Post by directory92 » Sun Mar 06, 2016 7:05 pm

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; ?>" />

Newbie

Posts

Joined
Sat May 12, 2012 6:59 pm
Who is online

Users browsing this forum: No registered users and 6 guests