This may be a strange question but having been burned too many times when deleting product I would like to ask a question regarding the function "zen_remove_product". If I were to comment out these statements (located in admin/includes/functions/general.php)
if (file_exists(DIR_FS_CATALOG_IMAGES . $product_image->fields['products_image'])) {
@unlink(DIR_FS_CATALOG_IMAGES . $product_image->fields['products_image']);
}
if (file_exists(DIR_FS_CATALOG_IMAGES . $filename_medium)) {
@unlink(DIR_FS_CATALOG_IMAGES . $filename_medium);
}
if (file_exists(DIR_FS_CATALOG_IMAGES . $filename_large)) {
@unlink(DIR_FS_CATALOG_IMAGES . $filename_large);
would the zen_remove_product function still remove the product but leave the image on the server?
Here is my reason for the request. I have many product that use the same images and deleting
one product could cause multiple product to no longer have an associated image. Also, it can be very time consuming (and in my opinion unnecessarily so) to have to reload images every time I delete a product.
In lieu of modifying the function I suppose I could first upload all the product I want to delete with a dummy image name and then upload the product(s) for delete (using EasyPopulate). However, this does not cover circumstances when I might delete a product using the Zen Cart admin.
I guess I am just trying to save myself a lot of extra time with having to reload deleted images.
The BEST solution would be to have a Configuration option that would give the user the choice to delete or not delete an image on product delete. If I knew how to add an option to the Zen Cart admin I would do that and then submit as a mod.
I appreciate any helpful responses.


Reply With Quote
