@@ -61,6 +61,10 @@ public function resolve(
6161 /** @var Wishlist $wishlist */
6262 $ wishlist = $ value ['model ' ];
6363
64+ if ($ context ->getExtensionAttributes ()->getStore () instanceof StoreInterface) {
65+ $ args ['store_id ' ] = $ context ->getExtensionAttributes ()->getStore ()->getStoreId ();
66+ }
67+
6468 /** @var WishlistItemCollection $wishlistItemCollection */
6569 $ wishlistItemsCollection = $ this ->getWishListItems ($ wishlist , $ args );
6670 $ wishlistItems = $ wishlistItemsCollection ->getItems ();
@@ -100,12 +104,15 @@ private function getWishListItems(Wishlist $wishlist, array $args): WishlistItem
100104
101105 /** @var WishlistItemCollection $wishlistItemCollection */
102106 $ 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 ) {
106112 return $ store ->getId ();
107- }, $ this ->storeManager ->getStores ()))
108- ->setVisibilityFilter ();
113+ }, $ this ->storeManager ->getStores ()));
114+ }
115+ $ wishlistItemCollection ->setVisibilityFilter ();
109116 if ($ currentPage > 0 ) {
110117 $ wishlistItemCollection ->setCurPage ($ currentPage );
111118 }
@@ -115,4 +122,4 @@ private function getWishListItems(Wishlist $wishlist, array $args): WishlistItem
115122 }
116123 return $ wishlistItemCollection ;
117124 }
118- }
125+ }
0 commit comments