magento 重写Customer中Helper的Address.php,在那添加新的方法,让phtml调用,可是好像调用不成功

小小个 发布于 2015/06/01 11:36
阅读 471
收藏 0
配置文件config.xml
<?xml version="1.0"?>
    <config>
        <modules>
            <YGXD_Customer>
            <version>1.6.2.0.3</version>
            </YGXD_Customer>
        </modules>
        <global>
            <helpers>
              <customer>
                  <rewrite>                         <address>YGXD_Customer_Helper_Address</address>
                 </rewrite>
             </customer>
           </helpers>
            </global>
  </config>
Helper中的Address.php

class YGXD_Customer_Helper_Address extends Mage_Customer_Helper_Address
{
     public function showAllZipCodeAction() {
        echo "12";
                   }
}
edit.phtml调用

 <?php echo $this->helper('customer/address')->showAllZipCodeAction()?>


然后出现了 

Fatal error: Call to undefined method Mage_Customer_Helper_Address::showAllZipCodeAction() in D:\software\wamp\www\magento1910\app\design\frontend\rwd\default\template\customer\address\edit.phtml on line 128

这种错误,没有调用我重写的Helper,哪位大神能指导一下!

加载中
返回顶部
顶部