当侧栏中的所有项目都被删除时,心愿单部分消失了。但是即使没有希望列表中的项目“添加一些项目到您的愿望清单”,我也想拍摄它。像“比较部分”一样..我该怎么做?需要求职者帮助
我试着编辑.phtml文件做它,但它不工作..我需要编辑这个任何XML布局文件?
当侧栏中的所有项目都被删除时,心愿单部分消失了。但是即使没有希望列表中的项目“添加一些项目到您的愿望清单”,我也想拍摄它。像“比较部分”一样..我该怎么做?需要求职者帮助
我试着编辑.phtml文件做它,但它不工作..我需要编辑这个任何XML布局文件?
仅供参考,请不要声讨。 (看计数)
* @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;
}
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();
}
谢谢你的代码... – balanv 2011-04-05 10:41:27