Mage_Wishlist_Block_Customer_Sidebar Class Reference

Inheritance diagram for Mage_Wishlist_Block_Customer_Sidebar:

Mage_Catalog_Block_Product_Abstract Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 getWishlistItems ()
 getWishlist ()
 getCanDisplayWishlist ()
 getRemoveItemUrl ($item)
 getAddToCartItemUrl ($item)

Protected Member Functions

 _toHtml ()

Protected Attributes

 $_wishlist = null


Detailed Description

Definition at line 35 of file Sidebar.php.


Member Function Documentation

_toHtml (  )  [protected]

Render block HTML

Returns:
string

Reimplemented from Mage_Core_Block_Template.

Definition at line 66 of file Sidebar.php.

00067     {
00068         if( sizeof($this->getWishlistItems()->getItems()) > 0 ){
00069             return parent::_toHtml();
00070         } else {
00071             return '';
00072         }
00073     }

getAddToCartItemUrl ( item  ) 

Definition at line 85 of file Sidebar.php.

00086     {
00087         return Mage::helper('wishlist')->getAddToCartUrlBase64($item);
00088     }

getCanDisplayWishlist (  ) 

Definition at line 75 of file Sidebar.php.

00076     {
00077         return Mage::getSingleton('customer/session')->isLoggedIn();
00078     }

getRemoveItemUrl ( item  ) 

Definition at line 80 of file Sidebar.php.

00081     {
00082         return $this->getUrl('wishlist/index/remove',array('item'=>$item->getWishlistItemId()));
00083     }

getWishlist (  ) 

Definition at line 44 of file Sidebar.php.

00045     {
00046         if(is_null($this->_wishlist)) {
00047             $this->_wishlist = Mage::getModel('wishlist/wishlist')
00048                 ->loadByCustomer(Mage::getSingleton('customer/session')->getCustomer());
00049 
00050             $collection = $this->_wishlist->getProductCollection()
00051                 ->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())
00052                 //->addAttributeToFilter('store_id', array('in'=>$this->_wishlist->getSharedStoreIds()))
00053                 ->addStoreFilter()
00054                 ->addAttributeToSort('added_at', 'desc')
00055                 ->setCurPage(1)
00056                 ->setPageSize(3)
00057                 ->addUrlRewrite();
00058 
00059             Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
00060             Mage::getSingleton('catalog/product_visibility')->addVisibleInSiteFilterToCollection($collection);
00061         }
00062 
00063         return $this->_wishlist;
00064     }

getWishlistItems (  ) 

Definition at line 39 of file Sidebar.php.

00040     {
00041         return $this->getWishlist()->getProductCollection();
00042     }


Member Data Documentation

$_wishlist = null [protected]

Definition at line 37 of file Sidebar.php.


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:24:56 2009 for Magento by  doxygen 1.5.8