V1.7 Remove empty categories

terawiz2020

New member
XNullUser
Joined
Jan 15, 2022
Messages
22
Reaction score
13
Points
3
NullCash
7
Hello,

This script removes all categories without associated products.

Built for an integrated store with Bigbuy, where this supplier creates categories without products at each request.

Running in Prestashop 1.7.7 and 1.7.8

Instalation:
1 - unzip
2 - upload the file remove-empty-categories.php to your prestashop root
3 - run the script from yourdomain.com/remove-empty-categories.php

Note: If you have you store integrated with other platform or supplier erp, you can add a cron job to run the url.
 

Attachments

  • remove-empty-categories.zip
    360 bytes · Views: 7

mo1373

Member
XNullUser
Joined
Aug 29, 2020
Messages
931
Reaction score
0
Points
18
NullCash
9
demo please?
 

Spasoo

Active member
XNullUser
Joined
Dec 23, 2021
Messages
116
Reaction score
83
Points
28
NullCash
469
Thank you very much !
 

hxcode

Well-known member
Master
Diamond
Elite
Joined
Aug 16, 2020
Messages
3,264
Reaction score
357
Points
83
NullCash
47
thx for sharing
 

Sillumin

Well-known member
Pro
Master
Diamond
Elite
Joined
Jun 18, 2021
Messages
3,620
Reaction score
740
Points
113
NullCash
5,932
Can it be done by native features of Prestashop?
 

terawiz2020

New member
XNullUser
Joined
Jan 15, 2022
Messages
22
Reaction score
13
Points
3
NullCash
7
Updated
As far as i know, can be executed in phpmyadmin to remove categories. Directly in prestashop I don't know.

In the client that are using, bigbuy sends many categories without products, and runs in a cronjob every minute.
 
Last edited:
Top