2014-01-09 37 views
1

想在首页的topmenu显示默认商店语言。我已将 <block type="page/switch" name="store_language" as="store_language" template="page/switch/stores.phtml"/>放入page.xml,并且我在标头部分中拨打了<?php echo $this->getChildHtml('store_language') ?> 。但它不显示在标题或任何地方。 如果有人知道这一点,请帮助我。 谢谢!如何在magento的topmenu中显示商店语言?

回答

1

您可以使用phtml直接调用来显示商店语言。请致电topmenu上的代码。

这里的代码如下─

<?php 
echo $this->getLayout()->createBlock('page/switch')->setTemplate('page/switch/languages.phtml')->toHtml(); 
?> 
0

你可以在你的一个.phtml添加此

<?php 
    /** 
    * @var Mage_Core_Model_Locale $_locale 
    */ 
    $_locale = Mage::app()->getLocale(); 
    $_language = $_locale->getTranslation(
     $_locale->getLocale()->getLanguage(), 
     'language', 
     $_locale->getLocale() 
    ); 
    echo $_language; 
?>