Jump to content

Remove unused product images


Recommended Posts

Greetings,

 

Is there any script or module that allows to quickly remove old and unused images? I have had an online store with products IDs like 100, 101, 102 etc. and then cloned this shop to my localhost, removed all products there but they were still online, after creating new products locally I uploaded them not by any import export module but by uploading files and database. 

 

The old photos are still there I think because I didn't manually remove them from back office but rewriting database. Can somobody share script that removes images folder for non-existing IDs? Prestashop 1.6.0.14

 

Regards

Share this post


Link to post
Share on other sites

  • 3 months later...
  • 3 years later...
  • 3 months later...

Hi, yes I did.

The main project folder is /test/

The server directory is /Applications/MAMP/htdocs

*php log*

PHP Warning: include_once(/Applications/MAMP/htdocs/config/config.inc.php): failed to open stream: No such file or directory in /Applications/MAMP/htdocs/test/remove_unused_images.php on line 9
....

seems not to be the right path, thanks

 

Share this post


Link to post
Share on other sites

Uhmm.. It is for prestashop 1.6 so if You use 1.7 it won't work. Still, the error is quite clear - script cannot find config file so try to adjust it in this way that it will find it. Script use $shop_root value and I think it is not defined in Your shop because it wants to inlcude Applications/MAMP/htdocs/config/config.inc.php instead of Applications/MAMP/htdocs/test/config/config.inc.php. 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More