Magento get language code in template file

前端 未结 6 1966
余生分开走
余生分开走 2021-02-02 12:41

I need a helper function to get the current language code. I want to use it in a templete file, like /products/view.phtml, only for testing purposes.

Does it already exi

6条回答
  •  既然无缘
    2021-02-02 13:25

    You can also use :

    $languageCode = Mage::app()->getStore()->getLanguageCode();

    Don't forget to configure your store locales in your admin. Go to menu :

    System -> Configuration -> General -> Locale Options

    And set the correct Locale for each Websites or stores

提交回复
热议问题