如何在magento1.7货币符号后添加空格。
我已将默认货币更改为玻利维亚玻利维亚诺。它的值为 BOB。
在产品列表页面中,它像 VEB12.98 一样显示,我需要像 VEB 一样。12.98
如何在magento1.7货币符号后添加空格。
我已将默认货币更改为玻利维亚玻利维亚诺。它的值为 BOB。
在产品列表页面中,它像 VEB12.98 一样显示,我需要像 VEB 一样。12.98
从 1.7 开始,您实际上可以直接在管理区域中更改/编辑货币符号:
系统 > 管理货币 > 符号
相应地在符号 ¤ 附近编辑语言文件lib/Zend/Locale/Data/en.xml 或 lib/Zend/Locale/Data/en_US.xml 。
<currencyFormat>
<pattern>¤ #,##0.00;(¤ #,##0.00)</pattern>
</currencyFormat>
如果您使用的是 Magento Community Version < 1.7,您可以自己添加空间。
$_price = Mage::helper('core')->currency($_product->getPrice());
从上面的代码中获取价格 html,然后你可以使用 php 函数插入点和空格:
$_price = str_replace('VEB', 'VEB. ', $_price);
如果您已经使用过 Magento 1.7,Drew Hunter 的回答可能对您有所帮助。