Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,731
    Plugin Contributions
    27

    bug Delete Product - does not delete Attribute Images from server

    To reproduce:

    Working
    - Create a product
    - Upload an image to the product
    - Delete the product and the image deletes from the server

    Not Working
    - Create a product
    - Upload an image to the product
    - Add Attribute with Attributes Image Swatch
    - Delete the product and the image deletes from the server... but none of the additional attribute images will delete.

    Server hit 10,000 images in the images folder and got grumpy. Then this bug was found.
    Twitch.
    https://www.twitchtoo.com Do you work for free? Please donate.
    Twitch Base8 - Obsidian - This, is what's new.

  2. #2
    Join Date
    Dec 2011
    Location
    Wisconsin, USA
    Posts
    674
    Plugin Contributions
    21

    Default Re: Delete Product - does not delete Attribute Images from server

    Quote Originally Posted by twitchtoo View Post
    To reproduce:

    Working
    - Create a product
    - Upload an image to the product
    - Delete the product and the image deletes from the server

    Not Working
    - Create a product
    - Upload an image to the product
    - Add Attribute with Attributes Image Swatch
    - Delete the product and the image deletes from the server... but none of the additional attribute images will delete.

    Server hit 10,000 images in the images folder and got grumpy. Then this bug was found.
    If you delete the attribute options & values do the images get deleted at that point?

  3. #3
    Join Date
    Sep 2005
    Location
    Waikato, New Zealand
    Posts
    1,539
    Plugin Contributions
    3

    Default Re: Delete Product - does not delete Attribute Images from server

    Isn't that default behaviour as attribute images are often used by multiple products with those attributes, so they are not actually tied to the image as such.

    The attribute image is tied to the attribute, what happens when the attribute is deleted?

    as to 10,000 images in the images folder, are these all in the root images folder or the total of all images in various subdirectories?

    Years ago I wrote a script (no longer have it now as that site is defunct) that set a new default images subdirectory every month (kind of like wordpress does) for images uploaded via the admin products page
    Webzings Design
    Semi retired from Web Design

  4. #4
    Join Date
    Oct 2007
    Posts
    134
    Plugin Contributions
    0

    Default Re: Delete Product - does not delete Attribute Images from server

    Quote Originally Posted by nigelt74 View Post
    Isn't that default behaviour as attribute images are often used by multiple products with those attributes, so they are not actually tied to the image as such.

    The attribute image is tied to the attribute, what happens when the attribute is deleted?

    as to 10,000 images in the images folder, are these all in the root images folder or the total of all images in various subdirectories?

    Years ago I wrote a script (no longer have it now as that site is defunct) that set a new default images subdirectory every month (kind of like wordpress does) for images uploaded via the admin products page
    Hi, I want to delete images for all the deactivated products collectively. is there any way to do so?
    If I delete a product from the admin area, it deletes only the main image of the product. The additional images are still there on the server and are using a lot of disk space.

    Also, is there any way that i can delete all the deactivated products collectively? I have thousands of products which have been decativated now and want to make some disk space on the server.

    Can anyone hep me in this regard please?

    thanks in advance.

    muteyaar

  5. #5
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Delete Product - does not delete Attribute Images from server

    Quote Originally Posted by muteyaar View Post
    Hi, I want to delete images for all the deactivated products collectively. is there any way to do so?
    If I delete a product from the admin area, it deletes only the main image of the product. The additional images are still there on the server and are using a lot of disk space.

    Also, is there any way that i can delete all the deactivated products collectively? I have thousands of products which have been decativated now and want to make some disk space on the server.

    Can anyone hep me in this regard please?

    thanks in advance.

    muteyaar
    So, there is an image plugin that is intended to identify a discrepancy of image with product and I guess allow deletion from the tool or matching with a product, whichever the case. I believe that would help with the additional images files.

    As to deletion of products to make file storage space, well the two aren't quite directly linked that way. The image part, okay, get that. But the content seen by customers/entered to describe the product is not really taking disk space like you may be thinking about as its all in the database.

    As to performing bulk action on the database, there's EasyPopulate V4 which could be used to 1) identify the path to the primary image for the product 2) delete the product following standard ZC product deletion process, 3) with the information about the image could perform further actions/investigation into what images need to be removed.

    Be sure though that if you decide to go down the product deletion path that you will still have a good way for visitors that did have a link to the now deactivated product to be handled when the product no longer exists in the database.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  6. #6
    Join Date
    Oct 2007
    Posts
    134
    Plugin Contributions
    0

    Default Re: Delete Product - does not delete Attribute Images from server

    Quote Originally Posted by mc12345678 View Post
    So, there is an image plugin that is intended to identify a discrepancy of image with product and I guess allow deletion from the tool or matching with a product, whichever the case. I believe that would help with the additional images files.

    As to deletion of products to make file storage space, well the two aren't quite directly linked that way. The image part, okay, get that. But the content seen by customers/entered to describe the product is not really taking disk space like you may be thinking about as its all in the database.

    As to performing bulk action on the database, there's EasyPopulate V4 which could be used to 1) identify the path to the primary image for the product 2) delete the product following standard ZC product deletion process, 3) with the information about the image could perform further actions/investigation into what images need to be removed.

    Be sure though that if you decide to go down the product deletion path that you will still have a good way for visitors that did have a link to the now deactivated product to be handled when the product no longer exists in the database.
    Dear mc12345678, thanks for replying to my query.

    I understand well that the product description does not take much space on the server. But I have around 3 or 4 images per each product and the images are of 1MB size approximately each. So, it is taking big space. I could not find any plugin which can delete the additional images for multiple products. If there is any plugin which can delete just the additional images only and keep the main image intact, that will be the best option for me. I will in that case may not delete the old products and will be able to make some space on the server.

    Deleting the additional images through cpanel file manager one by one is very time taking process. So, I was thinking of some easier way of doing this collectively for multiple products.

    I hope to receive a helpful reply.

    Many thanks.

  7. #7
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Delete Product - does not delete Attribute Images from server

    Quote Originally Posted by muteyaar View Post
    Dear mc12345678, thanks for replying to my query.

    I understand well that the product description does not take much space on the server. But I have around 3 or 4 images per each product and the images are of 1MB size approximately each. So, it is taking big space. I could not find any plugin which can delete the additional images for multiple products. If there is any plugin which can delete just the additional images only and keep the main image intact, that will be the best option for me. I will in that case may not delete the old products and will be able to make some space on the server.

    Deleting the additional images through cpanel file manager one by one is very time taking process. So, I was thinking of some easier way of doing this collectively for multiple products.

    I hope to receive a helpful reply.

    Many thanks.
    Not entirely sure you understand the difference between the space taken by the product and the space taken by the image. The product information including the path to the image(s) is in the database. The files are on the server.

    Now that said, there is a image purge utility that likely still works even on newer versions of ZC. I haven't used it, but it is one way I can see approaching the issue: https://www.zen-cart.com/downloads.php?do=file&id=1690

    So, from the download page it looks like the images are scavenged and a "database" match is determined. If the image(s) don't fit some pattern that is expected by ZC then they could/would be deleted. So, thing is, for that to come up true (suggest testing on a backup of your site), then the database record for images of disabled product would need to be "cleared". So, you could either use one of the mass upload/download products to support making a backup of the product information (specifically the image path) before wiping that information, or can run a sql command to clear the products_image path for all product that have products_status = 0 or any other set of constraints. Once there is no record in the database for the images to be deleted, then the above plugin should be able to be run and the additional images deleted. Again, assuming that I understood the content of the description correctly.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 

Similar Threads

  1. v139h Modify function to NOT delete image on product delete
    By JohnBoyCR in forum General Questions
    Replies: 5
    Last Post: 7 Jun 2012, 06:00 PM
  2. insert/update/delete products from remote server
    By wallmonk in forum All Other Contributions/Addons
    Replies: 8
    Last Post: 10 May 2012, 04:50 PM
  3. Q- Image of product will delete when i delete the product ?
    By kimsonvu in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 2 Feb 2009, 05:58 AM
  4. One delete button to delete all checked items from cart
    By gsdcypher in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 5 Jul 2007, 04:41 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR