- Posts: 212
- Thank you received: 17
Delete all child categories but not the parent categories
- smithshop123
-
Topic Author
- Offline
Less
More
7 years 2 months ago #310194
by smithshop123
-- HikaShop version -- : 4.2.1
-- Joomla version -- : 3.9.11
-- PHP version -- : 7.2.21
-- Browser(s) name and version -- : opera
-- Error-message(debug-mod must be tuned on) -- : not an error
Hi,
Is there an easy way to delete all sub-categories without deleting the parent categories. Our parent categories have graphics set up and don't change. However our site is large and the subcategories change a lot and frequently.
At the moment we do this manually which takes a long time. I did notice that there was a 'category_level_' parameter in mass actions but couldn't get it to work.
Thanks,
Ian and Stu
-- Joomla version -- : 3.9.11
-- PHP version -- : 7.2.21
-- Browser(s) name and version -- : opera
-- Error-message(debug-mod must be tuned on) -- : not an error
Hi,
Is there an easy way to delete all sub-categories without deleting the parent categories. Our parent categories have graphics set up and don't change. However our site is large and the subcategories change a lot and frequently.
At the moment we do this manually which takes a long time. I did notice that there was a 'category_level_' parameter in mass actions but couldn't get it to work.
Thanks,
Ian and Stu
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 12953
- Thank you received: 1778
7 years 2 months ago - 7 years 2 months ago #310199
by Mohamed Thelji
Replied by Mohamed Thelji on topic Delete all child categories but not the parent categories
Hello,
Using that kind of mass actions (cf attached screenshot) will probably do the job, and for more information :
www.hikashop.com/support/documentation/167-massaction-form.html
Where category_parent_id is the ID of the category in which you want to delete child categories.
We wish you a nice day!
Kind regards,
Mohamed Thelji
Using that kind of mass actions (cf attached screenshot) will probably do the job, and for more information :
www.hikashop.com/support/documentation/167-massaction-form.html
Where category_parent_id is the ID of the category in which you want to delete child categories.
We wish you a nice day!
Kind regards,
Mohamed Thelji
Last edit: 7 years 2 months ago by Mohamed Thelji.
Please Log in or Create an account to join the conversation.
- smithshop123
-
Topic Author
- Offline
Less
More
- Posts: 212
- Thank you received: 17
7 years 1 month ago #310690
by smithshop123
Replied by smithshop123 on topic Delete all child categories but not the parent categories
Hi,
your solution work but only for one parent category. I tried to add another entry and, although it recognised that there were child categories, it didn't seem to delete them properly. When I went back to the 'Categories' menu they were still there. Rebuilding the menu tree didn't help.
Should I be using some sort of logical and/or in the one line or maybe putting in the parent ids as a list?
Thanks,
Ian
p.s. In 'mass actions' the addition entries register as '0' (i.e. being deleted) but, as mentioned above, still appear in the 'category' menu. So it might be a database thing.
your solution work but only for one parent category. I tried to add another entry and, although it recognised that there were child categories, it didn't seem to delete them properly. When I went back to the 'Categories' menu they were still there. Rebuilding the menu tree didn't help.
Should I be using some sort of logical and/or in the one line or maybe putting in the parent ids as a list?
Thanks,
Ian
p.s. In 'mass actions' the addition entries register as '0' (i.e. being deleted) but, as mentioned above, still appear in the 'category' menu. So it might be a database thing.
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 12953
- Thank you received: 1778
7 years 1 month ago #310699
by Mohamed Thelji
Replied by Mohamed Thelji on topic Delete all child categories but not the parent categories
Hello,
There's actually no logical "OR" filter for mass actions, only "AND".
So the solution will probably be to create one mass action per category to manage.
The solution will be to either create a mass action per category, or directly develop a script which will do it.
Kind regards,
Mohamed Thelji.
There's actually no logical "OR" filter for mass actions, only "AND".
So the solution will probably be to create one mass action per category to manage.
Yes, it is because it will only check in your database, categories which have that ID as a category_parent_id, so it won't enable you to manage child categories.So it might be a database thing.
The solution will be to either create a mass action per category, or directly develop a script which will do it.
Kind regards,
Mohamed Thelji.
Please Log in or Create an account to join the conversation.
- smithshop123
-
Topic Author
- Offline
Less
More
- Posts: 212
- Thank you received: 17
7 years 1 month ago #310732
by smithshop123
Replied by smithshop123 on topic Delete all child categories but not the parent categories
Thanks,
it was ok deleting all of the children in the first parent. But other parent categories didn't work in the same mass action. As you say I may need one for each but running about fifty of them individually is slower than manually so we'll stick to that unfortuately.
ian and stu
it was ok deleting all of the children in the first parent. But other parent categories didn't work in the same mass action. As you say I may need one for each but running about fifty of them individually is slower than manually so we'll stick to that unfortuately.
ian and stu
Please Log in or Create an account to join the conversation.
Time to create page: 0.097 seconds