Since the free Yahoo API no longer works for automatic currency updates in OC, I was wondering if anyone has managed to find a new free provider?
All of the ones I have found that offer a free API are restricted to certain currencies, none of which I can use. And yes, whilst I can use a different default currency as a workaround, it means I will need to change all product pricing in the store to accommodate for this (which is not ideal).
Surely someone has managed to replace it? Any help/info with this is appreciated.
Cheers, Sam
Extensions for affiliates (openCart 1, 2, 3):
Advanced Multi Level Affiliate System
Customer and Affiliate Accounts Combined into one Account
Affiliate Tracking with Coupons
Discount for Referred Customers - Order Total
Type Tracking Code
Mass Pay
Affiliate Transactions for openCart 3
Affiliate Pack X - all modules with 40% discount
Extensions for affiliates (openCart 1, 2, 3):
Advanced Multi Level Affiliate System
Customer and Affiliate Accounts Combined into one Account
Affiliate Tracking with Coupons
Discount for Referred Customers - Order Total
Type Tracking Code
Mass Pay
Affiliate Transactions for openCart 3
Affiliate Pack X - all modules with 40% discount
Yahoo currency API not providing service for updated currency anymore.
We had made an update extension for the previous released OpenCart system now.
User can upload the extension with change the API without edit code.
https://www.opencart.com/index.php?rout ... n_id=32694

My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
It uses fixer.io, so probably won't help in this situation.
Extensions for affiliates (openCart 1, 2, 3):
Advanced Multi Level Affiliate System
Customer and Affiliate Accounts Combined into one Account
Affiliate Tracking with Coupons
Discount for Referred Customers - Order Total
Type Tracking Code
Mass Pay
Affiliate Transactions for openCart 3
Affiliate Pack X - all modules with 40% discount

But there are others for OC v.3 Versions as well, possibly easy to be made work:
Turkish Currency Update Patch
https://www.opencart.com/index.php?rout ... n_id=33183
Turkish Currency Update Patch v1.5
https://www.opencart.com/index.php?rout ... n_id=33425
My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.

Appreciate the help.
Cheers, Sam
Extensions for affiliates (openCart 1, 2, 3):
Advanced Multi Level Affiliate System
Customer and Affiliate Accounts Combined into one Account
Affiliate Tracking with Coupons
Discount for Referred Customers - Order Total
Type Tracking Code
Mass Pay
Affiliate Transactions for openCart 3
Affiliate Pack X - all modules with 40% discount
I used the free 'Exchange Rate Providers' module (https://www.opencart.com/index.php?rout ... n_id=32355) and attempted to add the free tool you provided to it, but I wasn't able to get it working. Here are the changes I made:
File: admin/model/localisation/currency.php
After:
Code: Select all
} elseif ($provider == 'openexchangerates') {
$url = "https://openexchangerates.org/api/latest.json?app_id=".$apikey."&base=".$base_currency."&symbols=".$currencies;
Code: Select all
} elseif ($provider == 'freecurrencyconverter') {
$url = "https://free.currencyconverterapi.com/api/v6/convert?q=".$base_currency."_".$currencies."&compact=y";
Code: Select all
} elseif (($provider == 'openexchangerates') && !empty($response['error'])) {
$error = sprintf($this->language->get('error_rates_provider'), $this->language->get('rates_providers_'.$provider), $response['status'], $response['description']);
Code: Select all
} elseif (($provider == 'freecurrencyconverter')) {
$error = sprintf($this->language->get('error_rates_provider'), $this->language->get('rates_providers_'.$provider), 0, $response['error']);
Before:
Code: Select all
array('value' => 'openexchangerates', 'title' => $this->language->get('rates_providers_openexchangerates')));
Code: Select all
array('value' => 'freecurrencyconverter', 'title' => $this->language->get('rates_providers_freecurrencyconverter')),
After:
Code: Select all
$_['rates_providers_openexchangerates'] = "OpenExchangeRates";
Code: Select all
$_['rates_providers_freecurrencyconverter'] = "Free Currency Converter";
**Notice that both the default currency (AUD) and the USD currency both have the default value of 1.00000000

Any ideas on how to get this working? I'm sure I'm missing something simple...
Cheers, Sam
Code: Select all
{"AUD_GBP":{"val":0.563793},"AUD_CAD":{"val":0.957239}}
Extensions for affiliates (openCart 1, 2, 3):
Advanced Multi Level Affiliate System
Customer and Affiliate Accounts Combined into one Account
Affiliate Tracking with Coupons
Discount for Referred Customers - Order Total
Type Tracking Code
Mass Pay
Affiliate Transactions for openCart 3
Affiliate Pack X - all modules with 40% discount
Code: Select all
public function refresh($force = false) {
$currency_data = array();
if ($force) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "currency WHERE code != '" . $this->db->escape($this->config->get('config_currency')) . "'");
} else {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "currency WHERE code != '" . $this->db->escape($this->config->get('config_currency')) . "' AND date_modified < '" . $this->db->escape(date('Y-m-d H:i:s', strtotime('-1 day'))) . "'");
}
foreach ($query->rows as $result) {
$curl = curl_init();
$currency_key = $this->config->get('config_currency') . '_' . $result['code'];
curl_setopt($curl, CURLOPT_URL, 'https://free.currencyconverterapi.com/api/v6/convert?q=' . $currency_key . '&compact=ultra');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
$content = curl_exec($curl);
curl_close($curl);
$content = json_decode($content, true);
if(isset($content[$currency_key])) $this->db->query("UPDATE " . DB_PREFIX . "currency SET value = '" . (float)$content[$currency_key] . "', date_modified = '" . $this->db->escape(date('Y-m-d H:i:s')) . "' WHERE code = '" . $this->db->escape($result['code']) . "'");
}
$this->db->query("UPDATE " . DB_PREFIX . "currency SET value = '1.00000', date_modified = '" . $this->db->escape(date('Y-m-d H:i:s')) . "' WHERE code = '" . $this->db->escape($this->config->get('config_currency')) . "'");
$this->cache->delete('currency');
}
Extensions for affiliates (openCart 1, 2, 3):
Advanced Multi Level Affiliate System
Customer and Affiliate Accounts Combined into one Account
Affiliate Tracking with Coupons
Discount for Referred Customers - Order Total
Type Tracking Code
Mass Pay
Affiliate Transactions for openCart 3
Affiliate Pack X - all modules with 40% discount
Users browsing this forum: No registered users and 58 guests