2013-02-21 63 views
0

昨天我为自己的头建了一个自定义的货币切换器,一切正常。今天,我来设置目录页面,发现我需要删除左列中的标准货币切换器,我打开了我的local.xml并添加了一个删除货币。也许愚蠢的选择,我经过摆弄后得到left.currency被删除,当我突然注意到我在我的文件之一做了什么已经停止我的标题自定义货币切换器显示。Magento标题中的自定义货币切换器消失了吗?

local.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挣扎后我试图删除货币和因为我不知道如何引用它试图杀死所有货币,我可以找到,当我twigged我不再确定当我删除顶级货币。

回答

2

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

+0

由于工作就像一个魅力,但我不知道为什么。 – 2013-02-22 09:21:04

+1

您指定了'template/currency',其中不存在该名称的块类型。在您的布局xml文件(app/design/frontend/base/default/layout)中,您会找到一个名为'directory.xml'的文件来引用货币的块类型。它指向'template =“directory/currency.phtml”'带有'block type =“directory/currency”'。如果块类型是“模板/货币”,那么你的代码就可以工作。我希望这可以清楚一点。 – seanbreeden 2013-02-22 15:07:47