block - Custom currency switcher in Magento header vanished? -
i built custom currency switcher header yesterday, working well. today came setup catalog pages , found myself needing remove standard currency switcher in left column, opened local.xml , add together remove currency. silly selection perhaps, managed after fiddleing left.currency removed when noticed had done in 1 of files had stopped header custom currency switcher displaying.
local.xml
<?xml version="1.0" encoding="utf-8"?> <layout> <default> <!-- remove callouts , 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 together 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>
first part of 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">
test/default/template/currency/currency.phtml
<?php if($this->getcurrencycount() > 1): ?> <div class="currency-block"> <ul> <?php foreach ($this->getcurrencies() $_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; ?> chosen currency"> <?php echo mage::app()->getlocale()->currency($_code)->getsymbol(); ?> </a> </li> <?php endforeach; ?> </ul>
from remember need create block, assign position , phone call out. i've been clearing cache while fiddeling, reloaded in currency conversion data, removed , retested "remove" in local removed left bars currency, 1 has come after removed remove left.currency top 1 never came back.
these current files, no removes @ currency now, i'm not sure when vanished i've been playing left sidebar stuff, after css struggles tried remove currency , did not know how reference tried killing off currency find , when twigged no longer sure when removed top currency.
try changing type="template/currency"
type="directory/currency"
magento block magento-1.7
No comments:
Post a Comment