Results 1 to 10 of 1688

Hybrid View

  1. #1
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: products_image_large equivalent

    Got to looking at what was provided above, and well, for the most part the code is "right", but in trying to apply product image zoom (plugin available from cvhainb) doesn't appear that the javascript for that plugin is getting loaded, so the extra code doesn't seem to help. I'm working to see what it takes to get that javascript loaded, but atthe same time am I to assume that it is more desirable to just get the zoom to work that is part of IH4 instead? That's a different (yet somewhat similar) path/set of code.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  2. #2
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: products_image_large equivalent

    Okay, had to force the javascript files to load for the plugin Product Image Zoom (http://www.zen-cart.com/downloads.php?do=file&id=1815) and it worked using the following code: Off to see about implementing product image zoom included with IH4 which now that I think about it probably was the initial intent/request. :)

    Code:
    <?php
    /**
     * Module Template
     *
     * @package templateSystem
     * @copyright Copyright 2003-2011 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
    * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: tpl_modules_main_product_image.php 18698 2011-05-04 14:50:06Z wilt $
     */
    ?>
    <?php require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_MAIN_PRODUCT_IMAGE));
    /* Begin add 1 of 2 by mc12345678 to support product image zoom */
    if ($products_image != '') {
     if (function_exists('handle_image')) {
      $newimg = handle_image($products_image_large, addslashes($products_name), LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT, '');
      list($src, $alt, $width, $height, $parameters) = $newimg;
      $products_image_large_test = zen_output_string($src);
      if (file_exists($products_image_large_test)) {
       $products_image_large = $products_image_large_test;
      }
     } 
    }
    /* End add 1 of 2 by mc12345678 to support product image zoom 14-10-31*/
     ?> 
    <div id="productMainImage" class="centeredContent back">
    <script language="javascript" type="text/javascript"><!--
    document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $_GET['products_id']) . '\\\')">' . zen_image(addslashes($products_image_medium), addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT,/* Begin add 2 of 2 by mc12345678 14-10-31*/ (file_exists($template->get_template_dir('loader_product_image_zoom.php',DIR_WS_TEMPLATE, 'auto_loaders','auto_loaders'). 'loader_product_image_zoom.php') ? 'data-zoom-image="' . $products_image_large . '"' : '') /* End add 2 of 2 by mc12345678 14-10-31*/) . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>'; ?>');
    //--></script>
    <noscript>
    <?php
      echo '<a href="' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $_GET['products_id']) . '" target="_blank">' . zen_image($products_image_medium, $products_name, MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT) . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>';
    ?>
    </noscript>
    </div>
    Last edited by mc12345678; 2 Nov 2014 at 06:02 AM. Reason: Forgot to include the code. :)
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: products_image_large equivalent

    Quote Originally Posted by mc12345678 View Post
    Okay, had to force the javascript files to load for the plugin Product Image Zoom (http://www.zen-cart.com/downloads.php?do=file&id=1815) and it worked using the following code: Off to see about implementing product image zoom included with IH4 which now that I think about it probably was the initial intent/request. :)
    Just an FYI.. previous attempts to get the IH hover to work on medium images rendered IH4 incompatible with compatible lightbox modules it now works just fine with.. Also turning on/off zoom on the medium images should be a configuration option.
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  4. #4
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: products_image_large equivalent

    May have broken with other light/color box programs, but worked with colorbox.in the writeup I did. Initially wasthinking since cvhainb's version didn't have a switch that it wouldntbe possible to offer the switch, but this morning thought about it again, and realized... Duh, of course it's possible,wouldbe dependent on IH4s switch not necessarily the zoom program being used...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

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

    Default Re: products_image_large equivalent

    So, dropped the product image zoom version of the above. Instead went with incorporating the existing zoom functionality of IH4, which I know Diva you dislike... :)

    Recommend adding to the IH4 installation package (and associated SQL) the following file:
    includes/templates/IH_INSTALL/templates/tpl_modules_main_product_image.php

    Code:
    <?php
    /**
     * Module Template
     *
     * @package templateSystem
     * @copyright Copyright 2003-2011 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: tpl_modules_main_product_image.php 18698 2011-05-04 14:50:06Z wilt $
     * Modified to support zoom functionality in IH4 by mc12345678 2014-11-02.
     */
    ?>
    <?php require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_MAIN_PRODUCT_IMAGE));
    if ($products_image != '') {
     if (function_exists('handle_image')) {
      $newimg = handle_image($products_image_large, addslashes($products_name), LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT, '');
      list($src, $alt, $width, $height, $parameters) = $newimg;
      $products_image_large_test = zen_output_string($src);
      if (file_exists($products_image_large_test)) {
       $products_image_large = $products_image_large_test;
       $newimg2 = handle_image(DIR_WS_IMAGES . $products_image, addslashes($products_name), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, '');
       list(, , , , $parameters2) = $newimg2;
      }
     } 
    }
     ?> 
    <div id="productMainImage" class="centeredContent back">
    <script language="javascript" type="text/javascript"><!--
    document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $_GET['products_id']) . '\\\')">' . zen_image(addslashes($products_image_medium), addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT, /* Begin add 2 of 2 by mc12345678 14-11-02 */ addslashes($parameters2) /* End add 2 of 2 by mc12345678 14-11-02 */ ) . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>'; ?>');
    //--></script>
    <noscript>
    <?php
      echo '<a href="' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $_GET['products_id']) . '" target="_blank">' . zen_image($products_image_medium, $products_name, MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT, /* Begin add 2 of 2 by mc12345678 14-11-02 */ addslashes($parameters2) /* End add 2 of 2 by mc12345678 14-11-02 */ ) . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>';
    ?>
    </noscript>
    </div>
    The above does not require any additional switch to turn on/off the zoom functionality as it is auto controlled when it comes to the builtin zoom functionality.

    As for the other code to co-work with what cvhainb put together, well, the constant to check against is:

    ZOOM_SMALL_IMAGES

    and can be anded (&&) with the file_exists check above for the auto_loader file in each of the single lines.

    If it really becomes something necessary to post, then can, but above uses the hover on image to enlarge
    feature of IH4.

    Peace.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  6. #6
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: products_image_large equivalent

    One caveat about the above solution is that it uses the large image when displaying the pop up. So for those that include both the default image and then upload a modified large image, the modified large image displays when using that above code.

    For those that upload one image for the product image, then the popup image is the large version of that.

    Additional images are untouched by the above.

    Not sure how things work when something like a plugin that will swap the default product image with one of the additional images or swap with a product that has an image for the attributes will work/look. So application of the changed code for the product image would more than likely need to beapplied on a case-by-case basis until more is understood/determined.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #7
    Join Date
    Oct 2005
    Location
    Hampshire, UK
    Posts
    96
    Plugin Contributions
    0

    Default Re: products_image_large equivalent

    Thank you so much for your input. It's all way above my head so I'll have to stick with copying files over until someone shares product info zoom with IH4.

  8. #8
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: products_image_large equivalent

    Quote Originally Posted by mc12345678 View Post
    So, dropped the product image zoom version of the above. Instead went with incorporating the existing zoom functionality of IH4, which I know Diva you dislike... :)
    I dislike it because it's a silly feature which really has little to do with IH4's PRIMARY purpose, and for that reason I have despised it's inclusion in IH.. That said, I know folks like it including some of my own clients.. **SHRUGS**

    Quote Originally Posted by mc12345678 View Post

    The above does not require any additional switch to turn on/off the zoom functionality as it is auto controlled when it comes to the builtin zoom functionality.
    and this ASSUMES that one would want to turn on image hover on both small and medium images.. that may NOT be the desired behavior.. Hence why I suggested that there be a configuration option for turning on/off zoom on medium images..
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

 

 

Similar Threads

  1. v158 Image Handler 5 (for v1.5.5 - v1.5.8) Support Thread
    By lat9 in forum All Other Contributions/Addons
    Replies: 749
    Last Post: 20 May 2026, 03:47 PM
  2. Attribute image replaces main product image on select [Support Thread]
    By exoticcorpse in forum All Other Contributions/Addons
    Replies: 176
    Last Post: 14 Dec 2025, 12:55 AM
  3. v139h Image Handler 3 Support Thread (for ZC v1.3.9)
    By DivaVocals in forum All Other Contributions/Addons
    Replies: 1095
    Last Post: 2 Oct 2017, 12:42 PM
  4. v138a Image Handler 2 (for ZC v1.3.8 ONLY) Support
    By timkroeger in forum All Other Contributions/Addons
    Replies: 7098
    Last Post: 12 Oct 2014, 03:48 AM
  5. Image Handler Support Please
    By nadinesky in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 30 Sep 2013, 03:47 PM

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