2011-04-02 68 views
0

當側欄中的所有項目都被刪除時,心願單部分消失了。但是即使沒有希望列表中的項目「添加一些項目到您的願望清單」,我也想拍攝它。像「比較部分」一樣..我該怎麼做?需要求職者幫助

我試着編輯.phtml文件做它,但它不工作..我需要編輯這個任何XML佈局文件?

回答

0

僅供參考,請不要聲討。 (看計數)

* @deprecated after 1.4.2.0 
    * @see Mage_Wishlist_Block_Links::__construct 
    * 
    * @return array 
    */ 
    public function addWishlistLink() 
    { 
     return $this; 
    } 

這裏是您所要求的功能:

的心願類已1.4.2之後改變

/** 
    * Add link on wishlist page in parent block 
    * 
    * @return Mage_Wishlist_Block_Links 
    */ 
    public function addWishlistLink() 
    { 
     $parentBlock = $this->getParentBlock(); 
     if ($parentBlock && $this->helper('wishlist')->isAllow()) { 
      $count = $this->helper('wishlist')->getItemCount(); 
      if ($count > 1) { 
       $text = $this->__('My Wishlist (%d items)', $count); 
      } 
      else if ($count == 1) { 
       $text = $this->__('My Wishlist (%d item)', $count); 
      } 
      else { 
       $text = $this->__('My Wishlist'); 
      } 
      $parentBlock->addLink($text, 'wishlist', $text, true, array(), 30, null, 'class="top-link-wishlist"'); 
     } 
     return $this; 
    } 
+0

謝謝你的代碼... – balanv 2011-04-05 10:41:27

0

Magento的1.6.1.0

/app/code/core/Mage/Wishlist/Block/Customer/Sidebar.php 

包含功能_toHtml()

protected function _toHtml() 
{ 
    if (($this->getCustomWishlist() && $this->getItemCount()) || $this->hasWishlistItems()) { 
     return parent::_toHtml(); 
    } 

    return ''; 
} 

複製:

/app/code/core/Mage/Wishlist/Block/Customer/Sidebar.php 

到:

/app/code/local/Mage/Wishlist/Block/Customer/Sidebar.php 

在複製的文件,以回報父母替換功能_toHtml()的內容:: _ toHtml();:

protected function _toHtml() 
{ 
     return parent::_toHtml(); 
}