易趣美元上产品价值背后的以下代码:
echo $i['sellingStatus'][0]['currentPrice'][0]['__value__'];
我正在尝试转换货币雷亚尔(巴西)如下,但不起作用:
echo $i['sellingStatus'][0]['convertedCurrentPrice'][0]['BRL']['__value__'];
有人知道我哪里错了吗?
XML中提到该值的部分是:
<sellingStatus><currentPrice currencyId="USD">21.84</currentPrice><convertedCurrentPrice currencyId="USD">21.84</convertedCurrentPrice><sellingState>Active</sellingState><timeLeft>P2DT4H30M45S</timeLeft></sellingStatus>
易趣不会为您进行原始货币转换,但当您从一个易趣区域检索物品到另一个区域时,它会进行礼貌的转换。易趣在巴西没有业务,因此您无法在BRL中请求定价信息。
为了获得特定货币的价格,您需要使用该国家/地区对应的SiteID进行呼叫。例如,如果你想要英镑的价格,你可以用SiteID 3打电话给英国。如果你用SiteID 77打电话给德国,你会得到欧元的价格。但不幸的是,巴西没有SiteID。您可以在此处查看所有易趣网站及其特定SiteID的列表