Public Member Functions | |
getWishlist () | |
hasItems () | |
getItemCount () | |
getItemCollection () | |
getProductCollection () | |
getSharingUrl () | |
getRemoveUrl ($item) | |
getAddUrl ($item) | |
getAddToCartUrl ($item) | |
getAddToCartUrlBase64 ($item) | |
getListUrl () | |
isAllow () | |
isAllowInCart () | |
getCustomerName () | |
getRssUrl () | |
isRssAllow () | |
defaultCommentString () | |
Protected Member Functions | |
_isCustomerLogIn () | |
_getCurrentCustomer () | |
Protected Attributes | |
$_wishlist = null | |
$_itemCount = null | |
$_itemCollection = null | |
$_productCollection = null |
Definition at line 32 of file Data.php.
_getCurrentCustomer | ( | ) | [protected] |
Retrieve logged in customer
Definition at line 54 of file Data.php.
00055 { 00056 return Mage::getSingleton('customer/session')->getCustomer(); 00057 }
_isCustomerLogIn | ( | ) | [protected] |
Retrieve customer login status
Definition at line 44 of file Data.php.
00045 { 00046 return Mage::getSingleton('customer/session')->isLoggedIn(); 00047 }
defaultCommentString | ( | ) |
getAddToCartUrl | ( | $ | item | ) |
Retrieve url for adding item to shoping cart
Mage_Wishlist_Model_Item | $item |
Definition at line 160 of file Data.php.
00161 { 00162 return $this->_getUrl('wishlist/index/cart', array('item'=>$item->getWishlistItemId())); 00163 }
getAddToCartUrlBase64 | ( | $ | item | ) |
Retrieve url for adding item to shoping cart with b64 referer
Mage_Wishlist_Model_Item | $item |
Definition at line 171 of file Data.php.
00172 { 00173 return $this->_getUrl('wishlist/index/cart', array( 00174 'item'=>$item->getWishlistItemId(), 00175 Mage_Core_Controller_Front_Action::PARAM_NAME_BASE64_URL => Mage::helper('core')->urlEncode( 00176 $this->_getUrl('*/*/*', array('_current'=>true)) 00177 ) 00178 )); 00179 }
getAddUrl | ( | $ | item | ) |
Retrieve url for adding product to wishlist
mixed | $product |
Definition at line 143 of file Data.php.
00144 { 00145 if ($item instanceof Mage_Catalog_Model_Product) { 00146 return $this->_getUrl('wishlist/index/add', array('product'=>$item->getId())); 00147 } 00148 if ($item instanceof Mage_Wishlist_Model_Item) { 00149 return $this->_getUrl('wishlist/index/add', array('product'=>$item->getProductId())); 00150 } 00151 return false; 00152 }
getCustomerName | ( | ) |
Definition at line 205 of file Data.php.
00206 { 00207 return $this->_getCurrentCustomer()->getName(); 00208 }
getItemCollection | ( | ) |
Retrieve wishlist items collection
Definition at line 104 of file Data.php.
00105 { 00106 if (is_null($this->_itemCollection)) { 00107 $this->_itemCollection = $this->getWishlist()->getProductCollection(); 00108 } 00109 return $this->_itemCollection; 00110 }
getItemCount | ( | ) |
Retrieve wishlist item count
Definition at line 88 of file Data.php.
00089 { 00090 if ($this->_isCustomerLogIn() && is_null($this->_itemCount)) { 00091 $this->_itemCount = $this->getWishlist()->getItemsCount(); 00092 } 00093 elseif(is_null($this->_itemCount)) { 00094 $this->_itemCount = 0; 00095 } 00096 return $this->_itemCount; 00097 }
getListUrl | ( | ) |
getProductCollection | ( | ) |
Definition at line 112 of file Data.php.
00113 { 00114 if (is_null($this->_productCollection)) { 00115 $this->_productCollection = $this->getWishlist()->getProductCollection(); 00116 } 00117 return $this->_productCollection; 00118 }
getRemoveUrl | ( | $ | item | ) |
Retrieve url for removing item from wishlist
Mage_Wishlist_Model_Item | $item |
Definition at line 132 of file Data.php.
00133 { 00134 return $this->_getUrl('wishlist/index/remove', array('item'=>$item->getWishlistItemId())); 00135 }
getRssUrl | ( | ) |
Definition at line 210 of file Data.php.
00211 { 00212 $customer = $this->_getCurrentCustomer(); 00213 $key = $customer->getId().','.$customer->getEmail(); 00214 return $this->_getUrl('rss/index/wishlist',array('data' => Mage::helper('core')->urlEncode($key), '_secure' => false)); 00215 }
getWishlist | ( | ) |
Retrieve wishlist by logged in customer
Definition at line 64 of file Data.php.
00065 { 00066 if (is_null($this->_wishlist)) { 00067 $this->_wishlist = Mage::getModel('wishlist/wishlist') 00068 ->loadByCustomer($this->_getCurrentCustomer()); 00069 } 00070 return $this->_wishlist; 00071 }
hasItems | ( | ) |
Retrieve wishlist items availability
Definition at line 78 of file Data.php.
00079 { 00080 return $this->getItemCount(); 00081 }
isAllow | ( | ) |
Definition at line 192 of file Data.php.
00193 { 00194 if (Mage::getStoreConfig('wishlist/general/active')) { 00195 return true; 00196 } 00197 return false; 00198 }
isAllowInCart | ( | ) |
Definition at line 200 of file Data.php.
00201 { 00202 return $this->isAllow() && $this->_isCustomerLogIn(); 00203 }
isRssAllow | ( | ) |
Definition at line 217 of file Data.php.
00218 { 00219 if (Mage::getStoreConfig('rss/wishlist/active')) { 00220 return true; 00221 } 00222 return false; 00223 }