bibob Posted May 25, 2016 Posted May 25, 2016 Hello is there any way to bulk delete empty categories by a query from the database? Share this post Link to post Share on other sites More sharing options...
bibob Posted May 25, 2016 Posted May 25, 2016 Found a solution DELETE FROM`ps_category` WHERE `id_category` != 1 and id_category not in (SELECT cp.id_category from ps_category_product cp ) ; DELETE FROM `ps_category_lang` where id_category not in (select id_category from ps_category);DELETE FROM `ps_category_group` where id_category not in (select id_category from ps_category);DELETE FROM `ps_category_shop` where id_category not in (select id_category from ps_category); 1 1 Share this post Link to post Share on other sites More sharing options...
pedash1 Posted November 5, 2016 Posted November 5, 2016 This is excellent Was successful Thankful Found a solution DELETE FROM`ps_category` WHERE `id_category` != 1 and id_category not in (SELECT cp.id_category from ps_category_product cp ) ; DELETE FROM `ps_category_lang` where id_category not in (select id_category from ps_category);DELETE FROM `ps_category_group` where id_category not in (select id_category from ps_category);DELETE FROM `ps_category_shop` where id_category not in (select id_category from ps_category); Share this post Link to post Share on other sites More sharing options...
oleksandr Posted September 9, 2018 Posted September 9, 2018 Удаление пустых категорий. Что были созданы при тестировании загрузчика, работает, спасибо. да можно было в ручную, но долго ! Share this post Link to post Share on other sites More sharing options...
Gipielle Posted April 20, 2020 Posted April 20, 2020 Hello, this query is for all prestashop versions ? Share this post Link to post Share on other sites More sharing options...
jmauclair Posted May 19, 2021 Posted May 19, 2021 (edited) On 4/21/2020 at 12:11 AM, Gipielle said: Hello, this query is for all prestashop versions ? I ps 1.7 replace ps_ by miib_ DELETE FROM`miib_category` WHERE `id_category` != 1 and id_category not in (SELECT cp.id_category from miib_category_product cp ) ; DELETE FROM `miib_category_lang` where id_category not in (select id_category from miib_category); DELETE FROM `miib_category_group` where id_category not in (select id_category from miib_category); DELETE FROM `miib_category_shop` where id_category not in (select id_category from miib_category); Edited July 4, 2021 by jmauclair (see edit history) 1 Share this post Link to post Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now