From ac84f01ba930ab68bf1b71e4eb087eafec2649f1 Mon Sep 17 00:00:00 2001 From: Tony <5071467+empiricompany@users.noreply.github.com> Date: Thu, 9 Sep 2021 09:57:08 +0200 Subject: [PATCH] fix flat catalog product reindex --- .../Meanbee/AutoCategories/Model/Auto/Category/Abstract.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app/code/community/Meanbee/AutoCategories/Model/Auto/Category/Abstract.php b/src/app/code/community/Meanbee/AutoCategories/Model/Auto/Category/Abstract.php index e2f5e98..cbb73f1 100644 --- a/src/app/code/community/Meanbee/AutoCategories/Model/Auto/Category/Abstract.php +++ b/src/app/code/community/Meanbee/AutoCategories/Model/Auto/Category/Abstract.php @@ -126,6 +126,10 @@ public function maintain($products = array()) { $this->getConnection()->query($insert); + if(Mage::helper('catalog/category_flat')->isEnabled()){ + Mage::getSingleton('index/indexer')->getProcessByCode('catalog_category_product')->reindexEverything(); + } + Mage::app()->setCurrentStore($originalStore); }