VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: Naturt on October 12, 2015, 09:48:31 AM

Title: Image handle in VM2 or VM3
Post by: Naturt on October 12, 2015, 09:48:31 AM
Hello there! My vm2 table (_virtuemart_medias) is over 4500 rows, and near 1MB. I have only 700 product in my webshop.
I can't believe there is no method for deleting unused or deleted products images. If I delete a product, why is the image stay in the folder? Why does not the program delete it? (In VM3 too)
Title: Re: Image handle in VM2 or VM3
Post by: GJC Web Design on October 12, 2015, 10:22:55 AM
QuoteWhy does not the program delete it?

For many already discussed reasons...

Have u searched on here?  There are various posts where people have offered script solutions to check and delete non used images
Title: Re: Image handle in VM2 or VM3
Post by: Studio 42 on October 12, 2015, 10:31:11 AM
Hi naturt,
QuoteIf I delete a product, why is the image stay in the folder? Why does not the program delete it? (In VM3 too)
The reason is that in VM2 or 3, you can use multiple time same images in different products and the _virtuemart_medias is the reference to the real file.

But of course, it would be a nice feature to have possibility to remove unused files and table référence directly in Virtuemart(and multi upload too).

Regards,
Patrick
Title: Re: Image handle in VM2 or VM3
Post by: Naturt on October 12, 2015, 10:42:38 AM
Hi guys! Thank you for the answers! GJC Web Design I searched for it, but I found only script solutions as you mentioned. I understand the _virtuemart_medias table through the images, but that table -depend on the work what it do- is growing and growing? I think it is not good for long-life webshops or webshops over 10.000 products.
I think about a manually solution: 1. get all of the category/vendor/product images what I use, and delete all of the rows from _virtuemart_medias except thoose ones.