0

我昨天为我的标题构建了一个自定义货币切换器,一切正常。今天我来设置目录页面,发现自己需要删除左栏中的标准货币切换器,我打开了我的 local.xml 并添加了对货币的删除。也许是愚蠢的选择,当我突然注意到我在我的一个文件中所做的某件事阻止了我的标题自定义货币切换器显示时,我设法让 left.currency 被删除。

本地.xml

<?xml version="1.0" encoding="UTF-8"?>
    <layout>
    <default>
    <!-- Remove callouts and rarely used stuff -->
    <remove name="right.poll"/>
    <remove name="right.permanent.callout"/>
    <remove name="left.permanent.callout"/>
    <remove name="paypal.partner.right.logo"/>
    <remove name="catalog.compare.list" />

    <!-- add the local stylesheet -->
    <reference name="head">
        <action method="addCss"><stylesheet>css/smoothness/jquery-ui-1.10.1.custom.css</stylesheet></action>
        <action method="addJs"><script>ahoy/jquery-1.9.1.js</script></action>
        <action method="addJs"><script>ahoy/jquery-ui-1.10.1.custom.js</script></action>
        <action method="addJs"><script>ahoy/script.js</script></action>

        <action method="addCss"><stylesheet>css/1140.css</stylesheet></action>
        <action method="addCss"><stylesheet>css/ahoy.css</stylesheet></action>          
    </reference>
    <reference name="header">
        <block type="template/currency" name="custom_currency_selector" template="currency/currency.phtml"/>
    </reference>

</default>

<catalog_category_view>
    <reference name="root">
        <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
    </reference>
</catalog_category_view>

header.phtml 的第一部分

<div class="header">
<div class="row">
    <div class="row">   
        <div class="sixcol">
            <?php echo $this->getChildHtml('topLinks') ?>
            <?php echo $this->getChildHtml('custom_currency_selector') ?>
        </div>
        <div class="sixcol last">
            <div class="row">

测试/默认/模板/货币/currency.phtml

<?php if($this->getCurrencyCount() > 1): ?>
<div class="currency-block">
<ul>
    <?php foreach ($this->getCurrencies() as $_code => $_name): ?>

    <?php $active = ($_code==$this->getCurrentCurrencyCode()) ? "active":""; ?>
    <li>
        <a class="<?php echo $active; ?>" href="<?php echo $this->getSwitchCurrencyUrl() . "currency/" . $_code; ?>" title="Set <?php echo $_code; ?> as your chosen currency">
            <?php echo Mage::app()->getLocale()->currency($_code)->getSymbol(); ?>
        </a>
    </li>
    <?php endforeach; ?>
</ul>

据我所知,这就是创建块、分配其位置并调用它所需的全部内容。我在摆弄时一直在清除缓存,我重新加载了货币转换数据,在本地删除并重新测试了删除左柱货币的“删除”,在我删除了 left.currency 的删除后,现在又回来了但第一名再也没有回来。

这些是我当前的文件,所以现在根本没有删除货币,我不确定它什么时候消失了,但我一直在玩左侧边栏的东西,在 css 挣扎之后我试图删除货币,因为我没有知道如何引用它试图杀死我能找到的所有货币,当我抽动时,我不再确定何时删除了顶级货币。

4

1 回答 1

2

尝试更改type="template/currency"type="directory/currency"

于 2013-02-21T18:13:32.557 回答