网站头部购物车页面修改如下:
<?php $_cartQty = $this->getSummaryCount() ?>
<div class="block-mini-cart" id="goodter"> <?php if ($_cartQty>0): ?> <?php //echo $this->__('Shopping Cart(Empty)')?> <?php echo $_cartQty; ?>item - <?php echo Mage::helper('checkout')->formatPrice($this->getSubtotal()) ?> <?php else: ?> <?php $symbol= Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol(); ?> <?php echo '<span class="empty">0 item - <span class="price">'.$symbol.'0.00</span> </span>';?> <?php endif ?> <div class="actions"> <a href="<?php echo Mage::getBaseUrl('web');?>checkout/cart/" rel="nofollow">View Bag</a><span>|</span> <a class="checkout" href="<?php echo Mage::getBaseUrl('web');?>checkout/onepage/" rel="nofollow">Checkout</a> </div></div>
网站的获取货币的方法
<script type="text/javascript">var urlAddress=parent.document.location;var pageName=document.title; function addfavorite(){try {window.external.addFavorite(urlAddress, pageName);}catch(e){try{window.sidebar.addPanel(pageName,urlAddress,"");}catch(e){alert('Unfortunately, your browser does not support this action,' + ' please bookmark this page manually by pressing Ctrl + D on PC or Cmd + D on Mac.');}}}function killErrors(){return true;}window.onerror=killErrors;</script>
<?php if($this->getCurrencyCount()>1): ?><div class="currency-view-switcher"><ul class="langandbookmark"> <li class="bookmark"><a class="bookmarka" onclick="addfavorite()" href="javascript:void(0)" rel="nofollow">Bookmark Page</a></li> <li class="home"><a href="http:///" title="home" rel="nofollow">Home</a></li> </ul><ul><li style="margin-top:5px;"><a rel="nofollow" class="c_currency"><img style="margin-top:6px;margin-right:8px" src="<?php echo $this->getSkinUrl('') ?>images/terry/<?php echo $this->getCurrentCurrencyCode(); ?>.jpg" /><?php echo Mage::app()->getLocale()->currency($this->getCurrentCurrencyCode())->getSymbol()." "; echo $this->getCurrentCurrencyCode(); ?></a><div class="ddkk"><?php $i=0; foreach ($this->getCurrencies() as $_code => $_name): ?><?php if($_code==$this->getCurrentCurrencyCode()){continue;}if($i==0){ $cClass='';}else{ $cClass='code_Class';}?>
<a rel="nofollow" class="rr<?php echo $_code ?> <?php echo $cClass;?>" href="<?php echo $this->getSwitchCurrencyUrl($_code) ?>"><span><img style="margin-right: 10px;margin-top: 3px;" src="<?php echo $this->getSkinUrl('') ?>images/terry/<?php echo $_code; ?>.jpg" /><?php echo Mage::app()->getLocale()->currency($_code)->getSymbol()." ";echo $_code ?></span></a><br /><?php $i++; endforeach; ?></div></li></ul></div><?php endif; ?>