View Single Post
  #342  
Old 07-01-2021, 01:12 AM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

Default Re: X-Cart reBOOT (reDUX) Template

Quote:
Originally Posted by Dougrun
A cool add-on for this would be a tool that removes images on discontinued/disabled products. I know xc4 doesn't like deleting products outright, it creates database integrity issues. We have 5208 products and add about 50/yr.

Hi Doug, I've just added a 'Cleanup Image Folders' button to the WEBP generator, which deletes any 'old' images from the file system that don't exist in the DB image tables. It's quite a handy little utility on it's own, especially if you have an old store.

Tested and works fine, but as a precaution before your first run, I'd make a backup of your /images/ folder.

Get the latest files and re-upload /images/webp/index.php

To delete images on disabled products, you'll need a separate script for that. You can try this ... untested, but should work in theory. The file should go in /admin.

The WEBP generator may struggle on super-large images, so if you get any problems, maybe check the source image file sizes first.

It has only snagged up on me once, which was due to some detailed images being gigantic (4000px +).

Or you can try increasing the memory_limit value...
Code:
ini_set('memory_limit', '128M');
__________________
xcartmods.co.uk
Reply With Quote