Magento 2:在 CMS 页面中获取商店国家全名
Magento 2: Get store country full name in CMS pages
我想在 CMS 页面中显示商店国家全名。
使用时:
{{config path="general/store_information/country_id"}}
它只显示 2 个字母的代码。喜欢"FR"。
但是我想显示 "France".
对于 phtml/php 你可以使用 this solution.
但是 CMS 页面和块如何解决这个问题?
这不是最优雅的解决方案,但您可以从您链接到的解决方案创建一个 PHTML 文件,然后使用 {{block class="Magento\Framework\View\Element\Template" template="Vendor_Module::myfiles/myfile.phtml"}}
.
从您的 page/static 块中调用它
我想在 CMS 页面中显示商店国家全名。
使用时:
{{config path="general/store_information/country_id"}}
它只显示 2 个字母的代码。喜欢"FR"。 但是我想显示 "France".
对于 phtml/php 你可以使用 this solution.
但是 CMS 页面和块如何解决这个问题?
这不是最优雅的解决方案,但您可以从您链接到的解决方案创建一个 PHTML 文件,然后使用 {{block class="Magento\Framework\View\Element\Template" template="Vendor_Module::myfiles/myfile.phtml"}}
.