diff --git a/core/lib/Thelia/Model/Category.php b/core/lib/Thelia/Model/Category.php index 8f1dd8eb4..9108c159e 100755 --- a/core/lib/Thelia/Model/Category.php +++ b/core/lib/Thelia/Model/Category.php @@ -121,6 +121,15 @@ class Category extends BaseCategory { $this->markRewritenUrlObsolete(); + //delete all subcategories + $subCategories = CategoryQuery::findAllChild($this->getId()); + + foreach($subCategories as $category) { + $category->setDispatcher($this->getDispatcher()); + + $category->delete(); + } + $this->dispatchEvent(TheliaEvents::AFTER_DELETECATEGORY, new CategoryEvent($this)); } } \ No newline at end of file