php - INR to USD convert values in opencart -
how convert inr rupees usd dollars in opencart. have tried below code...
$json_from = number_format($item_total, 2, '.', ''); $url = "http://rate-exchange.appspot.com/currency?from='.$json_from.'&to=usd"; $jsons = @file_get_contents($url); $json_data = json_decode($jsons, true); $to_cur = $json_data['results'][0]; $data['paymentrequest_0_itemamt'] = $to_curr; $data['paymentrequest_0_amt'] = $to_curr;
your url call api incorrect need call like,
$url = "http://rate-exchange.appspot.com/currency?from=inr&to=usd";
from there conversion rate convert inr usd if giving 0.0168728
, multiple amount expected result.
side note: can pass third parameter &q=4300
directly converted value api. example
demo.
Comments
Post a Comment