@@ -162,10 +162,10 @@ private function processAlerts(string $alertType, array $customerIds, int $websi
162
162
$ email ->setStoreId ($ storeId );
163
163
164
164
try {
165
- $ collection = $ this ->getAlertCollection ($ alertType , $ customerIds , $ websiteId , $ storeId );
165
+ $ collection = $ this ->getAlertCollection ($ alertType , $ customerIds , $ storeId );
166
166
} catch (\Exception $ e ) {
167
167
$ errors [] = $ e ->getMessage ();
168
- return $ errors ;
168
+ continue ;
169
169
}
170
170
171
171
/** @var Price|Stock $alert */
@@ -228,22 +228,16 @@ private function validateAlertType(string $alertType): void
228
228
*
229
229
* @param string $alertType
230
230
* @param array $customerIds
231
- * @param int $websiteId
232
231
* @param int $storeId
233
232
* @return AbstractCollection
234
233
* @throws \InvalidArgumentException
235
234
*/
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
+ {
242
237
switch ($ alertType ) {
243
238
case self ::ALERT_TYPE_STOCK :
244
239
$ collection = $ this ->stockCollectionFactory ->create ();
245
240
$ collection ->addFieldToFilter ('customer_id ' , ['in ' => $ customerIds ])
246
- ->addWebsiteFilter ($ websiteId )
247
241
->addStatusFilter (0 )
248
242
->addFilter ('store_id ' , $ storeId )
249
243
->setCustomerOrder ()
@@ -252,7 +246,6 @@ private function getAlertCollection(
252
246
case self ::ALERT_TYPE_PRICE :
253
247
$ collection = $ this ->priceCollectionFactory ->create ();
254
248
$ collection ->addFieldToFilter ('customer_id ' , ['in ' => $ customerIds ])
255
- ->addWebsiteFilter ($ websiteId )
256
249
->addFilter ('store_id ' , $ storeId )
257
250
->setCustomerOrder ()
258
251
->addOrder ('product_id ' );
0 commit comments