Post by Qphoria » Mon May 21, 2012 9:53 pm

Q: How can I use paypal if my currency isn't supported?
Q: How can I use a payment gateway that doesn't support my currency?
Q: Paypal doesn't support my currency?

A:
Up til 1.5.1.3, Paypal Standard did this automatically
In 1.5.2, it was changed (not for the better) to simply disable itself from the list of payments if using an unsupported currency. So that will need special instruction and maybe should be changed back in the core.

For now:
1. EDIT: catalog/model/payment/pp_standard.php

2. FIND AND REMOVE:

Code: Select all

if (!in_array(strtoupper($this->currency->getCode()), $currencies)) {
	$status = false;
}
3. EDIT: catalog/controller/payment/pp_standard.php

4. FIND (THE FIRST INSTANCE ONLY):

Code: Select all

$order_info = $this->model_checkout_order->getOrder
5. AFTER, ADD:

Code: Select all

$currencies = array('AUD','CAD','EUR','GBP','JPY','USD','NZD','CHF','HKD','SGD','SEK','DKK','PLN','NOK','HUF','CZK','ILS','MXN','MYR','BRL','PHP','TWD','THB','TRY');
if (!in_array(strtoupper($this->currency->getCode()), $currencies)) {
	$order_info['currency_code'] = 'USD';
}
Change "USD" with your choice of supported currency.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Qphoria » Sat Feb 23, 2013 3:56 am

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.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by a3u3 » Thu Sep 12, 2019 4:43 am

for opencart 2.3 is this way valid?

Newbie

Posts

Joined
Sun Sep 01, 2019 5:32 pm

Post by tingwing » Sat Oct 10, 2020 9:13 pm

for opencart3,

the second step is
at catalog/controller/extension/payment/pp_standard.php
find
$order_info = $this->model_checkout_order->getOrder($this->session->data['order_id']);

after it ,and
$order_info['currency_code'] = 'USD';

my extension:https://www.opencart.com/index.php?rout ... estshop24h
email :support@bestshop24h.com
site:http://www.bestshop24h.com


Active Member

Posts

Joined
Tue Aug 02, 2016 9:01 pm
Who is online

Users browsing this forum: No registered users and 2 guests