我在 ECBconverter 中配置自动更新汇率有一个严重问题
我是越南人,我想将越南盾汇率添加到货币转换器。我使用越南外贸股份商业银行 (Vietcombank) 的文件 XML 将欧元转换为越南盾 http://www.vietcombank.com.vn/ExchangeRates/ExrateXML.aspx
之前,我使用 Virtuemart 1.x 并在 ECBconverter.php 中添加更多代码。所以,没关系。没问题。
// now write new file
file_put_contents( $archivefile_name, $contents );
}
//code get exchange rate from vietcombank
$Link = new SimpleXMLElement('http://www.vietcombank.com.vn/ExchangeRates/ExrateXML.aspx',NULL,true);
foreach($Link->Exrate as $Exrate)
{
if ($Exrate['CurrencyCode']=="EUR") $tigia = $Exrate['Sell'];
}
//Add exchange rate VND-EUR into xml file
$contents = str_replace ("<Cube currency='USD'", " <Cube currency='EUR' rate='1'/><Cube currency='VND' rate='".$tigia."'/> <Cube currency='USD'", $contents);
/* XML Parsing */
但是,现在使用 Virtuemart 2.x。我将此代码添加到 ECBconverter.php 中它不起作用!我不知道为什么?
// now write new file
file_put_contents( $archivefile_name, $contents );
}
//code get exchange rate from vietcombank
$Link = new SimpleXMLElement('http://www.vietcombank.com.vn/ExchangeRates/ExrateXML.aspx',NULL,true);
foreach($Link->Exrate as $Exrate)
{
if ($Exrate['CurrencyCode']=="EUR") $tigia = $Exrate['Sell'];
}
//Add exchange rate VND-EUR into xml file
$contents = str_replace ("<Cube currency='USD'", " <Cube currency='EUR' rate='1'/><Cube Currency='VND' rate='".$tigia."'/> <Cube currency='USD'", $contents);
/* XML Parsing */
有人帮助我:(我非常非常需要你的帮助!谢谢大家。