Page 1 of 1

Converting Currency On Selecting Paypal

Posted: Fri May 10, 2013 8:15 pm
by darksecu
Hello Every One,
I am new here, trying to build a shopping portal.
Most Of my friends recommended OpenCart for this.

Just came up with a problem, when ever user try to checkout with currency as INR (Not supported by paypal) then it doesn't show paypal for checkout. (Modifying catalog/model/payment/paypal_standard.php Makes It Work)

instead i want to do something like showing all payment gateways, but if paypal standard is selected then automatically convert the total amount visible on confirm page into USD.

I have been doing php coding since a long time but i am familiar with fetching codes of opencart so not able to get it to work.

Piece Of Work I Thought Of
======================================
if ($selected_currency == 'INR' && $selected_gateway == 'paypal_standard') {
// 0.022 is conversion rate from inr to usd
// proceeding all values in inr to usd this way
$values_in_inr=$value_in_inr*0.022;
}
======================================

Waiting For Reply,
Rahul Shandilya

Re: Converting Currency On Selecting Paypal

Posted: Sun May 12, 2013 3:07 am
by darksecu
No one ??

Re: Converting Currency On Selecting Paypal

Posted: Sun Jun 02, 2013 8:30 pm
by ahmedfawzi55
Hello
i find this Solution here in Forum
http://forum.opencart.com/viewtopic.php?f=136&t=65005
Re: Q: How can I use paypal if my currency isn't supported?

Postby Qphoria ยป Fri Feb 22, 2013 7:56 pm
Alternatively, and this works for other payments too.... you can add code to force your currency to switch to a gateway supported currency


(v1.5.x)
1. EDIT: catalog/controller/payment/<payment>.php

2. FIND (FIRST INSTANCE ONLY):

Code: Select all

$order_info = $this->model_checkout_order->getOrder


3. AFTER, ADD (Replace USD with your choice of valid currency):

Code: Select all

$order_info['currency_code'] = 'USD';


Whatever currency you choose to use, be sure you have it in your list of currencies on your store in the Admin->System->Localisation->Currency page. It doesn't need to be enabled, just has to exist so that the conversion calculation can be done.

This will then auto convert the amount before it is sent to the gateway. The customer won't likely notice this.
They will see, for example, 1000 AED on the checkout page
But you will see $272.25 USD (based on the current conversion rate) in your paypal account.
i hope that help you
Best Regards

Re: Converting Currency On Selecting Paypal

Posted: Thu Jun 16, 2016 11:21 pm
by ashras99
will this still working, because i tried and that's not working. even after adding $order_info['currency_code'] = 'USD';
in 2.1.0.2

because i also wanted to show all payment gateways and when paypal standard is selected then automatically convert the total amount visible on confirm page into USD.

Re: Converting Currency On Selecting Paypal

Posted: Sat Dec 17, 2016 12:16 am
by phamxuanvinh2110
2.3.0.2, how can i fix it? the same topic