[英]Magento how to display country flag in currency drop down?
我想在magento的貨幣更改下拉列表中添加所有國家標志?
我如何在magento 1.4.2中做到這一點?
標志的很好的例子。 它可能會幫助其他人http://www.phptechi.com/magento-show-country-flags-selector-in-header.html
如該帖子所述:
步驟1:確保提供多種語言存儲。 現在打開位於app / design / frontend / default / theme / template / page / switch / flags.html的flags.phhml文件(如果不存在的話)創建它並替換現有代碼/在文件中添加以下代碼。
注意:請在以下代碼中修改href&src。
< ?php if(count($this->getGroups())>1): ?> < ?php foreach ($this->getGroups() as $_group): ?> < ?php echo $this->htmlEscape($_group->getName()) ?> < ?php endforeach; ?> < ?php endif; ?>
步驟2:現在將條目添加到page.xml文件和文件標題塊中,即“ html_header”。 如果要在頁腳部分添加標志,請搜索頁腳塊,然后在頁腳中添加以下行,並做一些小的CSS使其正確對齊。
步驟3:將標志圖像上傳到“ skin / frontend / currentTheme / images /”目錄中,並確保標志文件名具有商店名稱是標志名的一部分。 (即,圖像名稱為“ flagEnglish.gif”,“ flagGerman.gif”。因此商店名稱為“ English”,“ German”等)
現在清理magento緩存並重新加載主頁,您就完成了!!
magento中帶有標志的貨幣選擇器
在模板文件:app / design / frontend / default / your_theme / template / directory / currency.phtml(或app / design / frontend / base / default / template / directory / currency.phtml)中,將代碼更改為:
<?php foreach ($this->getCurrencies() as $_code => $_name): ?> <a href="<?php echo $this->getSwitchCurrencyUrl($_code) ?>" onclick="setLocation(this.value);"> <img src="<?php echo Mage::getBaseUrl('media').'flag/'.$_code.'.jpg'; ?>" title="<?php echo $_name ?> - <?php echo $_code ?>" alt="<?php echo $_name ?> - <?php echo $_code ?>" width="20" height="20" /> </a> <?php endforeach; ?>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.