Developer forum

Forum » Feature requests » eCom: On product delete, look for product images and delete

eCom: On product delete, look for product images and delete

Jacob Storgaard Jensen
Reply

Hi,

I've just had this client who hadn't deleted product images whenever she had deleted a product from eCom - resulting in a hell of a huge product images folder! Which she had to clean manually... She wasn't that happy ;-)

I would like to suggest a feature, where we could define the image naming conventions used - let's say Productnumber-Imagenumber.jpg - So the system would look for the product images whenever a product is deleted.

Let's say I delete a product with the product number 17000900, the system should then prompt me, the user, whether or not it should delete product images, if true, it should then look for the images 17000900-1.jpg, 17000900-2.jpg etc. in the folder specified in the ecom settings and delete them.

Does this make sence? I think it does :-)


Replies

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi Jacob,

For the time being, you could implement a NotificationSubscriber for eCommerce.Product.AfterDelete that responds to the deletion of products and then delete the corresponding files and products.

For the existing data, you could take a look at this little experiment: http://imar.spaanjaars.com/424/fun-with-linq and see if you can make it work for your setup.

Cheers,

Imar