Page 1 of 2 12 LastLast
Results 1 to 10 of 18
  1. #1
    Join Date
    Apr 2014
    Location
    Canada
    Posts
    249
    Plugin Contributions
    0

    Default Manufacturer image directory

    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?

  2. #2
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,108
    Plugin Contributions
    11

    Default Re: Manufacturer image directory

    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)

    Code:
    UPDATE manufacturers
    SET manufacturers_image = CONCAT('manufacturers/', manufacturers_image)
    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 = 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.

  3. #3
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,625
    Plugin Contributions
    123

    Default Re: Manufacturer image directory

    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.

  4. #4
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,108
    Plugin Contributions
    11

    Default Re: Manufacturer image directory

    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

  5. #5
    Join Date
    Apr 2014
    Location
    Canada
    Posts
    249
    Plugin Contributions
    0

    Default Re: Manufacturer image directory

    Quote Originally Posted by dbltoe View Post
    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)

    Code:
    UPDATE manufacturers
    SET manufacturers_image = CONCAT('manufacturers/', manufacturers_image)
    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 = 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.
    Beautiful! I'll give that a go. Can I assume I can apply this to my main images folder to move all my small product images to a 'small' folder? I've always wanted to do that. I feel it would be a cleaner approach.

  6. #6
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,108
    Plugin Contributions
    11

    Default Re: Manufacturer image directory

    Quote Originally Posted by plc613 View Post
    Beautiful! I'll give that a go. Can I assume I can apply this to my main images folder to move all my small product images to a 'small' folder? I've always wanted to do that. I feel it would be a cleaner approach.
    NO

    This will not move any files. In your original post you said
    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?
    The MySQL code with change the database to reflect the new location of the filenames.

  7. #7
    Join Date
    Apr 2014
    Location
    Canada
    Posts
    249
    Plugin Contributions
    0

    Default Re: Manufacturer image directory

    Quote Originally Posted by dbltoe View Post
    NO

    This will not move any files. In your original post you said
    The MySQL code with change the database to reflect the new location of the filenames.
    Yes. All I meant what the reference to the path. I can move the files to the folder via FTP as I expected. Is that what you mean?

  8. #8
    Join Date
    Apr 2014
    Location
    Canada
    Posts
    249
    Plugin Contributions
    0

    Default Re: Manufacturer image directory

    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.

  9. #9
    Join Date
    Apr 2014
    Location
    Canada
    Posts
    249
    Plugin Contributions
    0

    Default Re: Manufacturer image directory

    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

    12. Create another folder called small. Copy all the images from large to it.
    It may not have been intended to end up with a "small" folder if you follow the guide explicitly, the next step states,
    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.
    Whereby you'd end up with your main directory of images in a /small folder under 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.

  10. #10
    Join Date
    Apr 2014
    Location
    Canada
    Posts
    249
    Plugin Contributions
    0

    Default Re: Manufacturer image directory

    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?

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v151 Image directory
    By RiverCity in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 16 Dec 2013, 05:27 PM
  2. Add Manufacturer image to Manufacturer product page
    By vito in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 23 Jul 2010, 05:05 PM
  3. Adding another sub-directory level to Image Directory?
    By erko in forum General Questions
    Replies: 0
    Last Post: 31 May 2010, 12:33 PM
  4. manufacturer image on manufacturer page
    By bigbadboy in forum Templates, Stylesheets, Page Layout
    Replies: 9
    Last Post: 27 Dec 2009, 10:00 AM
  5. Removing Manufacturer Image without losing manufacturer
    By Jamie Bower in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 30 Jan 2009, 10:42 PM

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