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
990
Reaction score
1
Points
18
NullCash
9
demo please?
 

Snowden

Well-known member
Diamond
Elite
XNullUser
Joined
Dec 23, 2021
Messages
140
Reaction score
337
Points
63
NullCash
1,913
Thank you very much !
 

hxcode

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

Sillumin

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