magento首先显示多货币选项

1 在app/design/frontend/default/你的模板/template/创建目录directory,并在这个directory目录下面建一个phtml文件,名字为currency.phtml,内容如下:

<p><?php if($this->getCurrencyCount()>1): ?><br />

    <div><br />

    <div><br />

        <?php echo $this->__(' Currencies:') ?><br />

        <select name="currency" title="<?php echo $this->__('Select Your Currency') ?>" onchange="setLocation(this.value)"><br />

        <?php foreach ($this->getCurrencies() as $_code => $_name): ?><br />

            <option value="<?php echo $this->getSwitchCurrencyUrl($_code) ?>"<?php if($_code==$this->getCurrentCurrencyCode()): ?> selected="selected"<?php endif; ?>><br />

                <?php echo $_name ?> – <?php echo $_code ?><br />

            </option><br />

        <?php endforeach; ?><br />

        </select><br />

    </div><br />

</div><br />

<?php endif; ?></p>

2 找到路径:app/design/frontend/default/你的模板/layout/page.xml

 在page.xml里面找到  <block type=”page/html_header” name=”header” as=”header”>然后在这个block下面添加如下一个调用:

    <block type=”directory/currency” name=”tpcurrency” as=”tpcurrency” template=”directory/currency.phtml” />

3 确定了currency的位置之后就可以在头部header.phtml需要的位置添加货币模块了,具体代码:

<p><?php echo $this->getChildHtml('currency') ?> 把这段代码加在需要的位置就行了</p>

</div>

</div>