@@ -255,19 +255,11 @@ public function __construct(
255
255
public function reindexById ($ id )
256
256
{
257
257
try {
258
- $ this ->cleanProductIndex ([$ id ]);
259
-
260
- $ products = $ this ->productLoader ->getProducts ([$ id ]);
261
- $ activeRules = $ this ->getActiveRules ();
262
- foreach ($ products as $ product ) {
263
- $ this ->applyRules ($ activeRules , $ product );
264
- }
265
-
266
- $ this ->reindexRuleGroupWebsite ->execute ();
258
+ $ this ->doReindexByIds ([$ id ]);
267
259
} catch (\Exception $ e ) {
268
260
$ this ->critical ($ e );
269
261
throw new \Magento \Framework \Exception \LocalizedException (
270
- __ (' Catalog rule indexing failed. See details in exception log. ' )
262
+ __ (" Catalog rule indexing failed. See details in exception log. " )
271
263
);
272
264
}
273
265
}
@@ -404,6 +396,8 @@ protected function cleanByIds($productIds)
404
396
*
405
397
* @return void
406
398
* @throws \Exception
399
+ * @deprecated
400
+ * @see ReindexRuleProduct::execute
407
401
*/
408
402
private function assignProductToRule (Rule $ rule , int $ productEntityId , array $ websiteIds ): void
409
403
{
@@ -488,6 +482,8 @@ protected function applyRule(Rule $rule, $product)
488
482
*
489
483
* @param RuleCollection $ruleCollection
490
484
* @param Product $product
485
+ * @deprecated
486
+ * @see ReindexRuleProduct::execute
491
487
* @return void
492
488
*/
493
489
private function applyRules (RuleCollection $ ruleCollection , Product $ product ): void
0 commit comments