I build a webshop, but the client wants a second currency, HKD. In the node-record.tpl.php file I found the line responsible for displaying the price:
print uc_currency_format($node->sell_price);
I looked into the Drupal documentation, and found the function currency_api_converter. To use it, I thought it should be like this:
print ' ('. currency_api_convert('RMB', 'EUR', $node->sell_price) .')</div>';
But for some reason, all I get is a sort of Array error:
What am I doing wrong?
Function currency_api_convert() returns array of values
$result['value'] = $value;
$result['rate'] = $rate;
$result['timestamp'] = $timestamp;
$result['date'] = $date;
$result['time'] = $time;
$result['status'] = TRUE;
$result['message'] = 'success';
Then you should to rewrite your code to
$convert = currency_api_convert('RMB', 'EUR', $node->sell_price);
print ' ('. $convert['value'] .' EUR)</div>';