Menu

Let's Us Share What We Know

  • HOME
  • BLOG
  • Adding unsupported Paypal Currency for Opencart 1.5.4 checkout screen

Adding unsupported Paypal Currency for Opencart 1.5.4 checkout screen

1,December,2012

Recently we had to show the price in AED in an open cart eCommerce project. Even though we tried the solution as suggested in the OpenCart Forum, the conversion from AED ( a non-supported currency for PayPal) was not being converted to USD. We solved it as explained below : 1. EDIT : catalog/controller/payment/pp_standard.php 2. FIND (First Instance only)

$order_info = $this->model_checkout_order->getOrder
And add the following code above
if ($order_info)
$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'); //the  $currencies array now have a list of supported currencies supported by pal if (!in_array(strtoupper($this->currency->getCode()), $currencies)) { //Current currrency is not supported  by PayPal, so just overwrite currency code. $order_info['currency_code'] = 'USD'; }
Instead of using "your choice of supported currency" here as mentioned in the referenced link, we got the conversion working when we just overwrote the currency code as USD. 3. EDIT: catalog/model/payment/pp_standard.php FIND AND COMMENT THE BELOW LINE:
if (!in_array(strtoupper($this->currency->getCode()), $currencies)) { $status = false; }
References:
  1. http://forum.opencart.com/viewtopic.php?f=136&t=65005

Leave a Reply

Your email address will not be published. Required fields are marked *