Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // delete all empty Categories
- $acSql = "select s_categories.id from s_categories left join s_articles_categories_ro ro on ro.categoryID = s_categories.id where ro.id IS NULL and s_categories.parent is not null and s_categories.blog=false and s_categories.path is not null";
- $categoryIds = Shopware()->Db()->fetchAll($acSql);
- foreach($categoryIds as $catId){
- try {
- $this->getCategoryResource()->delete($catId['id']);
- }catch(\Exception $e){
- //do nothing
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement