0

getskinurl() 函数将进入基本路径以获取图像

<?php if(count($this->getStores())>1): ?>
<div id="languages_box">
<ul id='languages'>
<?php foreach ($this->getStores() as $_lang): ?>
<?php $_selected = ($_lang->getId() == $this->getCurrentStoreId()) ? ' selected="selected"' : '' ?>
<li><a href="<?php echo $_lang->getCurrententer code hereUrl() ?>">
<img src="<?php echo $this->getSkinUrl('images/flags/'.$_lang->getCode().'.gif');?>" alt="<?php echo $_lang->getCode();?>">
</li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
4

3 回答 3

2

嗨,你可以试试这个

<?php if(count($this->getStores())>1): ?>
<div class="language-switcher">
    <!--<span>Your Language: </span>-->
    <?php foreach ($this->getStores() as $_lang): ?>
        <a href="<?php echo $_lang->getCurrentUrl() ?>" title="<?php echo $this->htmlEscape($_lang->getName()) ?>">
            <?php //echo $this->htmlEscape($_lang->getCode()) ?>
            <img src="<?php echo $this->getSkinUrl('images/flag/').$this->htmlEscape($_lang->getCode()).'.png' ?>" alt="<?php echo $this->htmlEscape($_lang->getName()) ?>" />
        </a>
    <?php endforeach; ?>
</div>
<?php endif; ?>
于 2013-08-07T17:19:53.210 回答
0

当您不从 Magento 后端更改默认皮肤目录时,通常会发生这种情况。

系统 > 配置 > 常规 > 设计。

这应该更改为您的主题的皮肤文件夹。此外,如果默认目录已更改,但如果 magento 没有找到它,它将采用基本皮肤文件夹。

于 2013-08-07T11:14:14.073 回答
0
<?php if(count($this->getStores())>1): ?>
<div class="language-switcher">
    <!--<span>Your Language: </span>-->
    <?php foreach ($this->getStores() as $_lang): ?>
        <a href="<?php echo $_lang->getCurrentUrl() ?>" title="<?php echo $this->htmlEscape($_lang->getName()) ?>">
            <?php //echo $this->htmlEscape($_lang->getCode()) ?>
            <img src="<?php echo $this->getSkinUrl('images/flag/').$this->htmlEscape($_lang->getCode()).'.png' ?>" alt="<?php echo $this->htmlEscape($_lang->getName()) ?>" />
        </a>
    <?php endforeach; ?>
</div>
<?php endif; ?>
于 2013-09-03T11:10:25.067 回答