Public Member Functions | |
addWishlistFilter (Mage_Wishlist_Model_Wishlist $wishlist) | |
addWishListSortOrder ($attribute= 'added_at', $dir= 'desc') | |
addStoreData () | |
Protected Member Functions | |
_getAttributeFieldName ($attributeCode) |
Definition at line 35 of file Collection.php.
_getAttributeFieldName | ( | $ | attributeCode | ) | [protected] |
Rewrite retrieve attribute field name for wishlist attributes
string | $attributeCode |
Reimplemented from Mage_Eav_Model_Entity_Collection_Abstract.
Definition at line 110 of file Collection.php.
00111 { 00112 if ($attributeCode == 'days_in_wishlist') { 00113 return $this->_joinFields[$attributeCode]['field']; 00114 } 00115 return parent::_getAttributeFieldName($attributeCode); 00116 }
addStoreData | ( | ) |
Add store data (days in wishlist)
Definition at line 87 of file Collection.php.
00088 { 00089 if (!isset($this->_joinFields['e_id'])) { 00090 return $this; 00091 } 00092 00093 $dayTable = $this->_getAttributeTableAlias('days_in_wishlist'); 00094 $this->joinField('store_name', 'core/store', 'name', 'store_id=store_id'); 00095 $this->joinField('days_in_wishlist', 00096 'wishlist/item', 00097 "(TO_DAYS('" . Mage::getSingleton('core/date')->date() . "') - TO_DAYS(DATE_ADD(".$dayTable.".added_at, INTERVAL " .(int) Mage::getSingleton('core/date')->getGmtOffset() . " SECOND)))", 00098 'wishlist_item_id=wishlist_item_id' 00099 ); 00100 00101 return $this; 00102 }
addWishlistFilter | ( | Mage_Wishlist_Model_Wishlist $ | wishlist | ) |
Add wishlist filter to collection
Mage_Wishlist_Model_Wishlist | $wishlist |
Definition at line 44 of file Collection.php.
00045 { 00046 $this->_joinFields['e_id'] = array( 00047 'table' => 'e', 00048 'field' => 'entity_id' 00049 ); 00050 00051 $this->joinTable('wishlist/item', 00052 'product_id=e_id', 00053 array( 00054 'product_id' => 'product_id', 00055 'wishlist_item_description' => 'description', 00056 'store_id' => 'store_id', 00057 'added_at' => 'added_at', 00058 'wishlist_id' => 'wishlist_id', 00059 'wishlist_item_id' => 'wishlist_item_id', 00060 ), 00061 array( 00062 'wishlist_id' => $wishlist->getId(), 00063 'store_id' => array('in' => $wishlist->getSharedStoreIds()) 00064 ) 00065 ); 00066 return $this; 00067 }
addWishListSortOrder | ( | $ | attribute = 'added_at' , |
|
$ | dir = 'desc' | |||
) |
Add wishlist sort order
string | $att | |
string | $dir |
Definition at line 76 of file Collection.php.
00077 { 00078 $this->setOrder($attribute, $dir); 00079 return $this; 00080 }