如何获得Magento商店货币

时间:2012-07-18 20:45:28

标签: magento locale xml-rpc currency

我正在使用Magento XML-RPC api。 我还没有找到如何获得用于产品的当前商店国家/地区或货币。 是否可以通过Magento XML-RPC api获取货币信息。

任何文档链接都非常有用,谢谢。

2 个答案:

答案 0 :(得分:16)

存储货币代码,例如。的 USD

  

$ currency_code = Mage :: app() - > getStore() - > getCurrentCurrencyCode();

存储货币符号,例如。 $

  

$ currency_symbol = Mage :: app() - > getLocale() - >货币($ currency_code   ) - > getSymbol();

存储货币名称,例如。 美元

  

$ currency_name = Mage :: app() - > getLocale() - >货币($ currency_code   ) - >的getName();

Reference

答案 1 :(得分:9)

你走了:

$storeID = <whatever your store id is>;

Mage::app()->getStore($storeID)->getCurrentCurrencyCode();