Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2006
    Posts
    4
    Plugin Contributions
    0

    Default Additional Product Images Not Displaying

    Hello,

    Could some please tell me why my additional product image in not displaying here:

    Problem

    There's an empty box under the description that should have the additional images in it. The main product image name is :

    AnoFrame%20SwivelMount.jpg

    And the additional product image name uploaded is:

    AnoFrame%20SwivelMountaaa.jpg

    Thanks!

    EDITED: Never, ever post the zen_id or zenAdminID (session id) in a forum, email, newsgroup, newsletter, advertisement, etc. etc. etc. or you will be doomed ...
    Last edited by Ajeh; 4 Aug 2006 at 07:47 PM.

  2. #2
    Join Date
    Aug 2006
    Posts
    4
    Plugin Contributions
    0

    Default Re: Additional Product Images Not Displaying

    By the way this is my code for main_template_vars_images_additional.php:


    <?php
    if ($products_image != '') {
    // prepare image name
    $products_image_extention = substr($products_image, strrpos($products_image, '.'));
    $products_image_base = ereg_replace($products_image_extention . '$', '', $products_image);

    // if in a subdirectory
    if (strrpos($products_image, '/')) {
    $products_image_match = substr($products_image, strrpos($products_image, '/')+1);
    //echo 'TEST 1: I match ' . $products_image_match . ' - ' . $file . ' - base ' . $products_image_base . '<br>';
    $products_image_match = ereg_replace($products_image_extention, '', $products_image_match) . '_';
    $products_image_base = $products_image_match;
    }

    $products_image_directory = ereg_replace($products_image, '', substr($products_image, strrpos($products_image, '/')));
    if ($products_image_directory != '') {
    $products_image_directory = DIR_WS_IMAGES . ereg_replace($products_image_directory, '', $products_image) . "/";
    } else {
    $products_image_directory = DIR_WS_IMAGES;
    }

    // Check for additional matching images
    $file_extension = $products_image_extention;
    $products_image_match_array = array();
    if ($dir = @dir($products_image_directory)) {
    while ($file = $dir->read()) {
    if (!is_dir($products_image_directory . $file)) {
    if(preg_match("/" . $products_image_base . "/i", $file) == '1') {
    if (substr($file, 0, strrpos($file, '.')) != substr($products_image, 0, strrpos($products_image, '.'))) {
    if ($products_image_base . ereg_replace('^' . $products_image_base, '', $file) == $file) {
    $products_image_match_array[] = $file;
    // echo 'I AM A MATCH ' . $file . '<br>';
    } else {
    // echo 'I AM NOT A MATCH ' . $file . '<br>';
    }
    }
    }
    }
    }
    if (sizeof($products_image_match_array)) {
    sort($products_image_match_array);
    }
    $dir->close();
    }

    if (sizeof($products_image_match_array)) {
    echo ' <tr>';
    echo ' <td colspan="2" align="center" valign="top" class="plainBox">';
    echo '<table align="center">';
    echo "\n\n" . '<tr>';
    $new_images_cnt = 0;
    for ($i = 0, $n = sizeof($products_image_match_array); $i < $n; $i++) {
    if ($new_images_cnt >= IMAGES_AUTO_ADDED) {
    echo '<tr>';
    $new_images_cnt = 0;
    }

    $new_images_cnt ++;
    $file = $products_image_match_array[$i];
    $image_base = ereg_replace('^' . DIR_WS_IMAGES, '', $products_image_directory) . ereg_replace($products_image_extention . '$', '', $file);
    $products_image_additional = DIR_WS_IMAGES . $image_base . $products_image_extention;
    $products_image_large_additional = DIR_WS_IMAGES . 'large/' . $image_base . IMAGE_SUFFIX_LARGE . $products_image_extention;
    //echo 'WHO AM I ' . $products_image_large_additional . ' vs ' . $products_image_large_additional;
    ?>
    <td align="center" class="smallText">
    <script language="javascript" type="text/javascript"><!--
    document.write('<?php echo (file_exists($products_image_large_additional) ? '<a href="javascriptopupWindow(\\\'' . zen_href_link(FILENAME_POPUP_IMAGE_ADDITIONAL, 'pID=' . $_GET['products_id'] . '&pic=' . $i . '&products_image_large_additional=' . $products_image_large_additional) . '\\\')">' . zen_image($products_image_additional, addslashes($products_name), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>' : zen_image($products_image_additional, addslashes($products_name), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"')); ?>');
    //--></script>
    <noscript>
    <?php
    //$products_image_large_additional = $products_image_base . IMAGE_SUFFIX_LARGE . $file_extension;
    if (file_exists($products_image_large_additional)) {
    echo '<a href="' . zen_href_link(FILENAME_POPUP_IMAGE_ADDITIONAL, 'pID=' . $_GET['products_id'] . '&pic=' . $i . '&products_image_large_additional=' . $products_image_large_additional) . '" target="_blank">' . zen_image($products_image_additional, $products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>';
    } else {
    echo zen_image($products_image_additional, $products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br />';
    }
    ?>
    </noscript>
    </td>
    <?php
    if ($new_images_cnt >= IMAGES_AUTO_ADDED or $i == ($n-1)) {
    echo '</tr>' . "\n\n";
    }
    }
    echo '</table>';
    echo ' </td>';
    echo ' </tr>';
    }
    }
    ?>

  3. #3
    Join Date
    Jan 2005
    Location
    Lake Havasu, AZ
    Posts
    1,149
    Plugin Contributions
    0

    Default Re: Additional Product Images Not Displaying

    In order for the additional images to work they have to be named the same and then numbered... you state that you have your images named :

    AnoFrame%20SwivelMount.jpg

    And the additional product image name uploaded is:

    AnoFrame%20SwivelMountaaa.jpg

    Zen doesn't see those as the same name because of the aaa at the end

    In order for this particular image to have additional images you would want to name your images as :

    AnoFrame%20SwivelMount.jpg
    AnoFrame%20SwivelMount_01.jpg
    AnoFrame%20SwivelMount_02.jpg

    etc.


    I hope that helps
    When the world gets in my face I say Have A Nice Day.
    * I DO Think and I HAVE BEEN Zenned - therefore, I AM * I donate - do you?
    Custom Templates and Zen Services CRS Designs, Inc.

  4. #4
    Join Date
    Aug 2006
    Posts
    4
    Plugin Contributions
    0

    Default Re: Additional Product Images Not Displaying

    I just renamed my file to :

    AnoFrame%20SwivelMount_01.jpg

    But I still get the same blank result

  5. #5
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Additional Product Images Not Displaying

    When I view source for products_id 185 I am seeing the smaill image as:

    344c37d8a8309d4619905f3bc0a15c77.image.100x117.jpg

    Is something running to change the image names that would have all the extra periods in the name?

    This is confusing the images layout from the looks of things ...

    What happens if you name the group of images more conventionally with a

    basefilename.jpg

    Then name the additional images to match the group in the standard manner?

    basefilename_01.jpg
    basefilename_02.jpg
    basefilename_03.jpg
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  6. #6
    Join Date
    Aug 2006
    Posts
    4
    Plugin Contributions
    0

    Default Re: Additional Product Images Not Displaying

    No luck....when I removed

    AnoFrame%20SwivelMount_01.jpg

    from the ftp server, the box below the description disappears...so i know that zencart knows that there's another picture that exists but for some reason it still isn't showing.

  7. #7
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Additional Product Images Not Displaying

    Sounds like you may need to clear your cache in the Image Handler...
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. v154 Additional Product Images not displaying
    By apogeerockets in forum General Questions
    Replies: 6
    Last Post: 19 Apr 2016, 11:47 AM
  2. additional images not displaying
    By jenpen in forum Setting Up Categories, Products, Attributes
    Replies: 9
    Last Post: 16 Apr 2010, 03:55 PM
  3. Additional Product Images not displaying Large
    By rachaelosaurus in forum General Questions
    Replies: 12
    Last Post: 15 Apr 2010, 07:31 PM
  4. Product Info Page Additional Images Not Displaying After Upgrade
    By OutdoorsInteriors in forum Upgrading from 1.3.x to 1.3.9
    Replies: 2
    Last Post: 25 Jan 2009, 08:13 PM
  5. Additional Images Not Displaying
    By ironcross in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 26 Feb 2008, 08:38 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