Magento get language code in template file

前端 未结 6 1978
余生分开走
余生分开走 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:38

    Try

    $_language_code = substr(Mage::getStoreConfig('general/locale/code', $_store->getId()),0,2);
    

    where $_store is current store object

提交回复
热议问题