@@ -61,6 +61,10 @@ public function resolve(
61
61
/** @var Wishlist $wishlist */
62
62
$ wishlist = $ value ['model ' ];
63
63
64
+ if ($ context ->getExtensionAttributes ()->getStore () instanceof StoreInterface) {
65
+ $ args ['store_id ' ] = $ context ->getExtensionAttributes ()->getStore ()->getStoreId ();
66
+ }
67
+
64
68
/** @var WishlistItemCollection $wishlistItemCollection */
65
69
$ wishlistItemsCollection = $ this ->getWishListItems ($ wishlist , $ args );
66
70
$ wishlistItems = $ wishlistItemsCollection ->getItems ();
@@ -100,12 +104,15 @@ private function getWishListItems(Wishlist $wishlist, array $args): WishlistItem
100
104
101
105
/** @var WishlistItemCollection $wishlistItemCollection */
102
106
$ wishlistItemCollection = $ this ->wishlistItemCollectionFactory ->create ();
103
- $ wishlistItemCollection
104
- ->addWishlistFilter ($ wishlist )
105
- ->addStoreFilter (array_map (function (StoreInterface $ store ) {
107
+ $ wishlistItemCollection ->addWishlistFilter ($ wishlist );
108
+ if (isset ($ args ['store_id ' ])) {
109
+ $ wishlistItemCollection ->addStoreFilter ($ args ['store_id ' ]);
110
+ } else {
111
+ $ wishlistItemCollection ->addStoreFilter (array_map (function (StoreInterface $ store ) {
106
112
return $ store ->getId ();
107
- }, $ this ->storeManager ->getStores ()))
108
- ->setVisibilityFilter ();
113
+ }, $ this ->storeManager ->getStores ()));
114
+ }
115
+ $ wishlistItemCollection ->setVisibilityFilter ();
109
116
if ($ currentPage > 0 ) {
110
117
$ wishlistItemCollection ->setCurPage ($ currentPage );
111
118
}
@@ -115,4 +122,4 @@ private function getWishListItems(Wishlist $wishlist, array $args): WishlistItem
115
122
}
116
123
return $ wishlistItemCollection ;
117
124
}
118
- }
125
+ }
0 commit comments