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

Active member
XNullUser
Joined
Aug 29, 2020
Messages
1,058
Reaction score
2
Points
38
NullCash
0
demo please?
 

Snowden

Well-known member
Diamond
Elite
XNullUser
Joined
Dec 23, 2021
Messages
141
Reaction score
369
Points
63
NullCash
2,029
Thank you very much !
 

hxcode

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

Sillumin

Well-known member
☆ Pro ☆
Master
Diamond
Elite
Joined
Jun 18, 2021
Messages
3,620
Reaction score
782
Points
113
NullCash
6,226
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