File tree Expand file tree Collapse file tree 14 files changed +92
-54
lines changed
controllers/Customer/Wishlist/Product/Composite
Customer/Block/Account/Dashboard Expand file tree Collapse file tree 14 files changed +92
-54
lines changed Original file line number Diff line number Diff line change @@ -35,11 +35,25 @@ public function __construct()
35
35
#[\Override]
36
36
protected function _prepareCollection ()
37
37
{
38
- $ collection = Mage::getModel ('wishlist/item ' )->getCollection ()
39
- ->addCustomerIdFilter (Mage::registry ('current_customer ' )->getId ())
40
- ->addDaysInWishlist (true )
41
- ->addStoreData ()
42
- ->setInStockFilter (true );
38
+ $ customer = Mage::registry ('current_customer ' );
39
+ $ storeIds = Mage::app ()->getWebsite ($ this ->getWebsiteId ())->getStoreIds ();
40
+
41
+ $ wishlist = Mage::getModel ('wishlist/wishlist ' )
42
+ ->setSharedStoreIds ($ storeIds )
43
+ ->loadByCustomer ($ customer , true );
44
+
45
+ if ($ wishlist ) {
46
+ $ collection = $ wishlist ->getItemsCollection ();
47
+ } else {
48
+ $ collection = new Varien_Data_Collection ();
49
+ }
50
+
51
+ $ collection
52
+ ->setWebsiteId ($ customer ->getWebsiteId ())
53
+ ->setCustomerGroupId ($ customer ->getGroupId ())
54
+ ->resetSortOrder ()
55
+ ->setDaysInWishlist (true )
56
+ ->addStoreData ();
43
57
44
58
$ this ->setCollection ($ collection );
45
59
Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ protected function _prepareCollection()
90
90
->setWebsiteId ($ this ->_getCustomer ()->getWebsiteId ())
91
91
->setCustomerGroupId ($ this ->_getCustomer ()->getGroupId ())
92
92
->resetSortOrder ()
93
- ->addDaysInWishlist ( )
93
+ ->setDaysInWishlist ( true )
94
94
->addStoreData ();
95
95
96
96
$ this ->setCollection ($ collection );
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ public function getItemCollection()
52
52
if (is_null ($ collection )) {
53
53
$ collection = $ this ->getCreateOrderModel ()->getCustomerWishlist (true );
54
54
if ($ collection ) {
55
- $ collection = $ collection ->getItemCollection ()->load ();
55
+ $ collection = $ collection ->getItemsCollection ()->load ();
56
56
}
57
57
$ this ->setData ('item_collection ' , $ collection );
58
58
}
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ class Mage_Adminhtml_Customer_Wishlist_Product_Composite_WishlistController exte
38
38
/**
39
39
* Wishlist item we're working with
40
40
*
41
- * @var Mage_Wishlist_Model_Wishlist
41
+ * @var Mage_Wishlist_Model_Item
42
42
*/
43
43
protected $ _wishlistItem = null ;
44
44
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ public function getWishlist()
56
56
if (!$ this ->_wishlist ) {
57
57
$ this ->_wishlist = Mage::getModel ('wishlist/wishlist ' )
58
58
->loadByCustomer (Mage::getSingleton ('customer/session ' )->getCustomer ());
59
- $ this ->_wishlist ->getItemCollection ()
59
+ $ this ->_wishlist ->getItemsCollection ()
60
60
->addAttributeToSelect ('name ' )
61
61
->addAttributeToSelect ('price ' )
62
62
->addAttributeToSelect ('small_image ' )
@@ -67,7 +67,7 @@ public function getWishlist()
67
67
->load ();
68
68
}
69
69
70
- return $ this ->_wishlist ->getItemCollection ();
70
+ return $ this ->_wishlist ->getItemsCollection ();
71
71
}
72
72
73
73
/**
Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ protected function _prepareCollection($collection)
104
104
*/
105
105
protected function _createWishlistItemCollection ()
106
106
{
107
- return $ this ->_getWishlist ()->getItemCollection ();
107
+ return $ this ->_getWishlist ()->getItemsCollection ();
108
108
}
109
109
110
110
/**
Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ public function getCacheTags()
109
109
$ helper = $ this ->helper ('wishlist ' );
110
110
$ wishlist = $ helper ->getWishlist ();
111
111
$ this ->addModelTags ($ wishlist );
112
- foreach ($ wishlist ->getItemCollection () as $ item ) {
112
+ foreach ($ wishlist ->getItemsCollection () as $ item ) {
113
113
$ this ->addModelTags ($ item );
114
114
}
115
115
return parent ::getCacheTags ();
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ public function allcartAction()
74
74
$ hasOptions = [];
75
75
76
76
$ cart = Mage::getSingleton ('checkout/cart ' );
77
- $ collection = $ wishlist ->getItemCollection ()
77
+ $ collection = $ wishlist ->getItemsCollection ()
78
78
->setVisibilityFilter ();
79
79
80
80
$ qtysString = $ this ->getRequest ()->getParam ('qty ' );
Original file line number Diff line number Diff line change @@ -186,7 +186,7 @@ public function getItemCollection()
186
186
*/
187
187
protected function _createWishlistItemCollection ()
188
188
{
189
- return $ this ->getWishlist ()->getItemCollection ();
189
+ return $ this ->getWishlist ()->getItemsCollection ();
190
190
}
191
191
192
192
/**
Original file line number Diff line number Diff line change @@ -104,9 +104,9 @@ public function processAddToCart($observer)
104
104
return ;
105
105
}
106
106
107
- $ wishlist ->getItemCollection ()->load ();
107
+ $ wishlist ->getItemsCollection ()->load ();
108
108
109
- foreach ($ wishlist ->getItemCollection () as $ wishlistItem ) {
109
+ foreach ($ wishlist ->getItemsCollection () as $ wishlistItem ) {
110
110
if ($ wishlistItem ->getId () == $ wishlistId ) {
111
111
$ wishlistItem ->delete ();
112
112
}
You can’t perform that action at this time.
0 commit comments