@@ -162,10 +162,10 @@ private function processAlerts(string $alertType, array $customerIds, int $websi
162162 $ email ->setStoreId ($ storeId );
163163
164164 try {
165- $ collection = $ this ->getAlertCollection ($ alertType , $ customerIds , $ websiteId , $ storeId );
165+ $ collection = $ this ->getAlertCollection ($ alertType , $ customerIds , $ storeId );
166166 } catch (\Exception $ e ) {
167167 $ errors [] = $ e ->getMessage ();
168- return $ errors ;
168+ continue ;
169169 }
170170
171171 /** @var Price|Stock $alert */
@@ -228,22 +228,16 @@ private function validateAlertType(string $alertType): void
228228 *
229229 * @param string $alertType
230230 * @param array $customerIds
231- * @param int $websiteId
232231 * @param int $storeId
233232 * @return AbstractCollection
234233 * @throws \InvalidArgumentException
235234 */
236- private function getAlertCollection (
237- string $ alertType ,
238- array $ customerIds ,
239- int $ websiteId ,
240- int $ storeId
241- ): AbstractCollection {
235+ private function getAlertCollection (string $ alertType , array $ customerIds , int $ storeId ): AbstractCollection
236+ {
242237 switch ($ alertType ) {
243238 case self ::ALERT_TYPE_STOCK :
244239 $ collection = $ this ->stockCollectionFactory ->create ();
245240 $ collection ->addFieldToFilter ('customer_id ' , ['in ' => $ customerIds ])
246- ->addWebsiteFilter ($ websiteId )
247241 ->addStatusFilter (0 )
248242 ->addFilter ('store_id ' , $ storeId )
249243 ->setCustomerOrder ()
@@ -252,7 +246,6 @@ private function getAlertCollection(
252246 case self ::ALERT_TYPE_PRICE :
253247 $ collection = $ this ->priceCollectionFactory ->create ();
254248 $ collection ->addFieldToFilter ('customer_id ' , ['in ' => $ customerIds ])
255- ->addWebsiteFilter ($ websiteId )
256249 ->addFilter ('store_id ' , $ storeId )
257250 ->setCustomerOrder ()
258251 ->addOrder ('product_id ' );
0 commit comments