Templates 如何在PrestaShop 1.7模板中获取locale对象?
我在模板文件中使用Templates 如何在PrestaShop 1.7模板中获取locale对象?,templates,locale,prestashop-1.7,Templates,Locale,Prestashop 1.7,我在模板文件中使用Tools::displayPrice()函数以货币显示格式化的价格,但新版本(1.7.6.0)中此函数的文档说明: 那么如何在模板中使用Locale对象呢 -- 附笔。 PrestaShop的官方文档:乱七八糟,因此,如果有人能分享到某个完整可靠资源的链接,我(以及更多)将非常感谢谷歌的搜索结果: Context::getContext()->currentLocale->formatPrice(123.45,'EUR') 或者,例如,在模块中 $this->context-
Tools::displayPrice()
函数以货币显示格式化的价格,但新版本(1.7.6.0)中此函数的文档说明:
那么如何在模板中使用Locale
对象呢
--
附笔。
PrestaShop的官方文档:乱七八糟,因此,如果有人能分享到某个完整可靠资源的链接,我(以及更多)将非常感谢谷歌的搜索结果:
Context::getContext()->currentLocale->formatPrice(123.45,'EUR')代码>
或者,例如,在模块中
$this->context->currentLocale->formatPrice($price,$currencyCode)代码>
从
* @deprecated Since 1.7.6.0. Please use Locale::formatPrice() instead
* @see PrestaShop\PrestaShop\Core\Localization\Locale