Masse delete not fudet images
- the heatkiller
-
Topic Author
- Offline
-- Joomla version -- : 3.4
-- PHP version -- : 5.6.6
-- Browser(s) name and version -- : www.dcom.dk
Hello everyone
I was wondering if there is a function that can erase images which are not found or is damaged.
The reason I spøre into this is my sides have over 13000 products which are blver import with cvs but part of the bill shoulder does not look like it worked so I am to have found a way to find all the pictures that do not work on my since then it becomes clear again, that I may be new pictures up.
any good ideas?
Theis
Please Log in or Create an account to join the conversation.
There is not functions like that by default in HikaShop.
It will require a custom script.
What could potentially be done, is to export all the products in csv via the mass actions with only the images informations.
Then thanks to the custom script, look over all the images, and if they are not in the csv file so delete them.
It require good PHP knowledges.
Please Log in or Create an account to join the conversation.
- the heatkiller
-
Topic Author
- Offline
But do you think it is possible to get Hika system to brands the picture where the user defult picture on the database?
With a piece of text or something
Please Log in or Create an account to join the conversation.
Sorry but I don't really understand your question.
Please Log in or Create an account to join the conversation.
- the heatkiller
-
Topic Author
- Offline
If you look at this product,
www.dcom.dk/p/149513-
There are errors in the first image when image can not be found or it is broken.
If you could get hikashop every time it use the default picture to also deleted these images every time it can not be found or is damaged from File_paht then it would be easy for me to see which of my 13000 product does not have a real picture that works :whistle:
Please Log in or Create an account to join the conversation.
If HikaShop take the default picture that's because it can't find the image on the server, so we can't delete it as we don't know the path. But if you are talking about the entry in the database, yes, that could be a good thing.
I add it on our Todo list.
Please Log in or Create an account to join the conversation.
- the heatkiller
-
Topic Author
- Offline
but do you have a ide to what files i shall look in to ? to try to fix this problem
Please Log in or Create an account to join the conversation.
I think that the best place will be in the image helper: "administrator/components/com_hikashop/helpers/image.php" in the function "_checkImage()".
This function only check if the image exists, so if it is not the case, you could potentially delete the entry in the "#__hikashop_file" table.
Please Log in or Create an account to join the conversation.
- the heatkiller
-
Topic Author
- Offline
Please Log in or Create an account to join the conversation.
You can replace the function with that code:
Please Log in or Create an account to join the conversation.
- the heatkiller
-
Topic Author
- Offline
Please Log in or Create an account to join the conversation.
- the heatkiller
-
Topic Author
- Offline
Parse error: syntax error, unexpected 'path' (T_STRING) in /media/mynewdrive/html/Dcom3.0/administrator/components/com_hikashop/helpers/image.php on line 423
any idea
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
- the heatkiller
-
Topic Author
- Offline
Hmm what are we misssing
Please Log in or Create an account to join the conversation.
- the heatkiller
-
Topic Author
- Offline
Please Log in or Create an account to join the conversation.
A better solution, because easily customizable, and no code lost when updating will be to edit the view "product / show_block_img" via the menu Display > Views in HikaShop and at the top at the file add this code:
Please Log in or Create an account to join the conversation.
- the heatkiller
-
Topic Author
- Offline
Tanks you are lifesaver now it is easy to see what product the are missing images
You save me a lot off time
Theis
Please Log in or Create an account to join the conversation.