Mage_Customer_Block_Account_Dashboard_Sidebar Class Reference

Inheritance diagram for Mage_Customer_Block_Account_Dashboard_Sidebar:

Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 getShoppingCartUrl ()
 getCartItemsCount ()
 getWishlist ()
 getWishlistCount ()
 getWishlistAddToCartLink ($wishlistItem)
 getCompareItems ()
 getCompareJsObjectName ()
 getCompareRemoveUrlTemplate ()
 getCompareAddUrlTemplate ()
 getCompareUrl ()

Protected Attributes

 $_cartItemsCount
 $_wishlist
 $_compareItems


Detailed Description

Definition at line 35 of file Sidebar.php.


Member Function Documentation

getCartItemsCount (  ) 

Definition at line 53 of file Sidebar.php.

00054     {
00055         if( !$this->_cartItemsCount ) {
00056             $this->_cartItemsCount = Mage::getModel('sales/quote')
00057                 ->setId(Mage::getModel('checkout/session')->getQuote()->getId())
00058                 ->getItemsCollection()
00059                 ->getSize();
00060         }
00061 
00062         return $this->_cartItemsCount;
00063     }

getCompareAddUrlTemplate (  ) 

Definition at line 120 of file Sidebar.php.

00121     {
00122         return $this->getUrl('catalog/product_compare/add',array('product'=>'#{id}'));
00123     }

getCompareItems (  ) 

Definition at line 94 of file Sidebar.php.

00095     {
00096         if( !$this->_compareItems ) {
00097             $this->_compareItems = Mage::getResourceModel('catalog/product_compare_item_collection')
00098                 ->setStoreId(Mage::app()->getStore()->getId());
00099             $this->_compareItems->setCustomerId(Mage::getSingleton('customer/session')->getCustomerId());
00100             $this->_compareItems
00101                 ->addAttributeToSelect('name')
00102                 ->useProductItem()
00103                 ->load();
00104 
00105         }
00106 
00107         return $this->_compareItems;
00108     }

getCompareJsObjectName (  ) 

Definition at line 110 of file Sidebar.php.

00111     {
00112         return "dashboardSidebarCompareJsObject";
00113     }

getCompareRemoveUrlTemplate (  ) 

Definition at line 115 of file Sidebar.php.

00116     {
00117         return $this->getUrl('catalog/product_compare/remove',array('product'=>'#{id}'));
00118     }

getCompareUrl (  ) 

Definition at line 125 of file Sidebar.php.

00126     {
00127         return $this->getUrl('catalog/product_compare');
00128     }

getShoppingCartUrl (  ) 

Definition at line 48 of file Sidebar.php.

00049     {
00050         return Mage::getUrl('checkout/cart');
00051     }

getWishlist (  ) 

Definition at line 65 of file Sidebar.php.

00066     {
00067         if( !$this->_wishlist ) {
00068             $this->_wishlist = Mage::getModel('wishlist/wishlist')
00069                 ->loadByCustomer(Mage::getSingleton('customer/session')->getCustomer());
00070             $this->_wishlist->getItemCollection()
00071                 ->addAttributeToSelect('name')
00072                 ->addAttributeToSelect('price')
00073                 ->addAttributeToSelect('small_image')
00074                 ->addAttributeToFilter('store_id', array('in' => $this->_wishlist->getSharedStoreIds()))
00075                 ->addAttributeToSort('added_at', 'desc')
00076                 ->setCurPage(1)
00077                 ->setPageSize(3)
00078                 ->load();
00079         }
00080 
00081         return $this->_wishlist->getItemCollection();
00082     }

getWishlistAddToCartLink ( wishlistItem  ) 

Definition at line 89 of file Sidebar.php.

00090     {
00091         return Mage::getUrl('wishlist/index/cart', array('item' => $wishlistItem->getId()));
00092     }

getWishlistCount (  ) 

Definition at line 84 of file Sidebar.php.

00085     {
00086         return $this->getWishlist()->getSize();
00087     }


Member Data Documentation

$_cartItemsCount [protected]

Definition at line 37 of file Sidebar.php.

$_compareItems [protected]

Definition at line 46 of file Sidebar.php.

$_wishlist [protected]

Definition at line 44 of file Sidebar.php.


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

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