I initially uploaded my manufacturer images to the main images directory. Realizing this is less than ideal, I've moved them to the manufacturers directory and I'm hoping there is a batch-style method to tell zen cart I did that?
I initially uploaded my manufacturer images to the main images directory. Realizing this is less than ideal, I've moved them to the manufacturers directory and I'm hoping there is a batch-style method to tell zen cart I did that?
Quick thought to try AT YOUR OWN RISK
BACKUP
This is based upon the assumption that your current manufacturers_image has JUST the name of the file in the manufacturers_image field. (e.g. mancfacturer_microsoft.gif)
IF You have some folder name (e.g. images/mancfacturer_microsoft.gif), you will need to replace images with manufacturers.Code:UPDATE manufacturers SET manufacturers_image = CONCAT('manufacturers/', manufacturers_image)
Code:UPDATE manufacturers SET manufacturers_image = REPLACE(manufacturers_image, 'images', 'manufacturers')
Note that the first option is adding a folder and will need the closing / while the second is replacing the folder name and needs no closing / between the folder name and the image name.
Are You Vulnerable for an Accessibility Lawsuit?
myZenCartHost.com - Zen Cart Certified, PCI Compatible Hosting by JEANDRET
Free SSL, Domain, and MagicThumb with semi-annual and longer hosting.
My vote would be to just leave them where they were before. It's not necessary to have them in a sub folder.
That Software Guy. My Store: Zen Cart Modifications
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.
UNLESS.... They happen to start with the same designation as a product/attribute/category
I think the reason for having the separate directories was to not only make sure a whatever/ image didn't wind up as an extra product image but, also, to ensure that folks could easily have a whatever/ image that wouldn't get blown away with a separate delete request.
If you use widget.gif for the category, product, and manufacturer images; having them in the same directory can be a problem.
There's these new docs https://docs.zen-cart.com/user/image...-product-pages
Are You Vulnerable for an Accessibility Lawsuit?
myZenCartHost.com - Zen Cart Certified, PCI Compatible Hosting by JEANDRET
Free SSL, Domain, and MagicThumb with semi-annual and longer hosting.
Are You Vulnerable for an Accessibility Lawsuit?
myZenCartHost.com - Zen Cart Certified, PCI Compatible Hosting by JEANDRET
Free SSL, Domain, and MagicThumb with semi-annual and longer hosting.
dbltoe's suggests both worked for me. In my case I needed the second statement that REPLACES the folder path to accomplish my goal of moving my manufacturers logos to the subfolder. So my statement to change the manufacturers was:
UPDATE manufacturers
SET manufacturers_image = REPLACE(manufacturers_image, 'images', 'manufacturers')
As stated: in order to complete this successfully you must then move your actual files to the appropriate folder, in this case images/manufacturers via FTP or your hosts file manager.
And for my follow-up query to move my small images out of the main images folder to a "small" folder under images/ was:
UPDATE products
SET products_image = CONCAT('small/', 'products_image')
Since I'm adding to the path. As above, in order to complete this successfully you must then move your actual files to the appropriate folder, in this case images/small via FTP or your hosts file manager.
These code snippets were run in phpMyAdmin.
BTW my inspiration to do this in this manner came from the image preparation guide on ZC
https://www.zen-cart.com/content.php...aration-how-to
It may not have been intended to end up with a "small" folder if you follow the guide explicitly, the next step states,12. Create another folder called small. Copy all the images from large to it.
Whereby you'd end up with your main directory of images in a /small folder under images/13. Run a batch-process on the files in small to resize to 125 pixels square; you may as well optimize for web as well.
14. Upload them all to images.
Frankly I think is great and feels much more organizanized but opinions will differ no doubt.
Last edited by plc613; 2 Sep 2020 at 04:17 PM.
This all looked fine initially but now I noticed my _MED and _LRG images aren't working. I'm only guessing but could is be that the system only looks within the directory of the initial aka small image and in my case since it's images/small it can't find images/large and ../medium?
Bookmarks