Saturday, July 12, 2014
Home arrow News arrow Preventing VirtueMart From Deleting Product Images
Home News Forums Downloads Search Contact

When I was your age, programming was wire-wrapping backplanes in ones and zeros... and we liked it.


     
         
No account yet?
Preventing VirtueMart From Deleting Product Images

We've just added some hacked VirtueMart files to our downloads section to address the following VirtueMart bug:

When a product is deleted in VirtueMart, all the media files associated with that product are also deleted.  This can be a serious problem.  Old images of old products should never be automatically deleted from the server.  There are (at least) three reasons:

  1. There are Joomla plug-ins that insert product images into content.  Old press releases and archived articles include product images and still generate search engine traffic; and now they will have broken images and links.

  2. Many related products might use the same image.  (E.g., same tile or rug in different size.  Or a generic "hammer" cartoon used to illustrate all hammers.)  This is especially serious if you sell downloadable products, where one product might be part of several different bundles.  Deleting one bundle shouldn't destroy part of the contents of all the other bundles!

  3. Finally, it's been causing me hassles when using CSVI to bulk upload products:  If anything goes wrong with part of the bulk upload, I may delete some of the uploaded products and run the import again.  Now the import gives weird results because some of the the full-size images are missing.  When debugging a bulk upload, it's a pain to have to re-FTP a thousand images in between re-running each trial of the bulk upload.

The VirtueMart developers are unlikely to fix this any time soon.  One wrote: "If a product is deleted then I would expect any media files for that product to be deleted as well. Otherwise businesses that regularly change products as some become out of date or unobtainable would end up with a server full of old and no longer needed files. I believe that when a product is deleted its ID is also removed, so there would be complications in re-connecting with those media files that share the same product ID."

So we've  posted a hacked version of /home/www/administrator/components/com_virtuemart/classes/ps_product.php that fixes this. 

 
< Prev   Next >
Electronic Mother's favorite pizza topping:
 
 
 
Most popular incoming links: