Jurist Posted June 24, 2015 Share Posted June 24, 2015 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 Link to comment Share on other sites More sharing options...
navid68 Posted September 26, 2015 Share Posted September 26, 2015 Hi Jurist, did you find a solution? did you find a script? Navid Link to comment Share on other sites More sharing options...
hakeryk2 Posted February 28, 2019 Share Posted February 28, 2019 @navid68 check this Link to comment Share on other sites More sharing options...
ballashop Posted June 15, 2019 Share Posted June 15, 2019 On 2/28/2019 at 2:21 PM, hakeryk2 said: @navid68 check this Hi, I try in local server but I've got HTTP ERROR 500. Link to comment Share on other sites More sharing options...
hakeryk2 Posted June 16, 2019 Share Posted June 16, 2019 Have yout putted this file directly to your main shop file? It is constructed really easly and all You need to do is just to put this file into main folder of Your shop and call it like http://localhost/yourshop/remove_unused_images.php If You have 500 error on localhost then just go apache and php erros logs files and see what they are telling. Link to comment Share on other sites More sharing options...
ballashop Posted June 16, 2019 Share Posted June 16, 2019 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 Link to comment Share on other sites More sharing options...
hakeryk2 Posted June 16, 2019 Share Posted June 16, 2019 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. Link to comment Share on other sites More sharing options...
ballashop Posted June 16, 2019 Share Posted June 16, 2019 Hi and thanks to reply, I use PS 1.6 "is not defined in Your shop" => where I have to define it? In local every things works fine. Thanks Link to comment 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