Page 120 of 169 FirstFirst ... 2070110118119120121122130 ... LastLast
Results 1,191 to 1,200 of 1685
  1. #1191
    Join Date
    Oct 2005
    Location
    Hampshire, UK
    Posts
    96
    Plugin Contributions
    0

    Default Re: products_image_large equivalent

    Quote Originally Posted by BGundlach View Post
    You're absolutely right. I needed to run the handle_image function on my large image. I borrowed fual lightbox's zen_lightbox.php and voila working great. Thank you
    Hi there, I'm trying to find out the same thing but I don't understand what you replaced $products_image_large with? I did a search for the handle_image function on the developers toolkit and saw a few results. I did look into the files but really don't understand what to replace it with.

    I've found the following code on zen colorbox:
    Code:
    // hook for handle_image() function such as Image Handler etc
      if (function_exists('handle_image')) {
        $newimg = handle_image($src, $alt, $width, $height, $parameters);
        list($src, $alt, $width, $height, $parameters) = $newimg; 
      }
    I tried replacing $products_image_large with $newimg_large and checking the source code shows up a blank I'm trying to get Product Image Zoom plugin to point to IH4 large image instead of having to put large images into the images/large folder.

    Thank you for your patience!
    Last edited by nipinuk; 31 Oct 2014 at 06:06 PM.

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

    Default Re: products_image_large equivalent

    Quote Originally Posted by nipinuk View Post
    Hi there, I'm trying to find out the same thing but I don't understand what you replaced $products_image_large with? I did a search for the handle_image function on the developers toolkit and saw a few results. I did look into the files but really don't understand what to replace it with.

    I've found the following code on zen colorbox:
    Code:
    // hook for handle_image() function such as Image Handler etc
      if (function_exists('handle_image')) {
        $newimg = handle_image($src, $alt, $width, $height, $parameters);
        list($src, $alt, $width, $height, $parameters) = $newimg; 
      }
    I tried replacing $products_image_large with $newimg_large and checking the source code shows up a blank I'm trying to get Product Image Zoom plugin to point to IH4 large image instead of having to put large images into the images/large folder.

    Thank you for your patience!
    The code snippet above provides the characteristics of the image to be displayed as a type of an "array" with the image source returned as $src. If you take a look at IH4s includes/modules/YOUR_TEMPLATE/additional_images.phpfor example, you will see a similar function call with $products_image_large assigned to zen_output_string($src). This type of assignment for your situation would need to be performed after the original image is identified, but before the image is displayed/used further.

    Looking atthe code a little further, there is yet more "work" done to ensure all things associated with the assignment of the image is correct. (Ie, the path/file is pulled from the correct location. Etc.)
    Last edited by mc12345678; 31 Oct 2014 at 06:22 PM.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

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

    Default Re: products_image_large equivalent

    Quote Originally Posted by mc12345678 View Post
    Looking atthe code a little further, there is yet more "work" done to ensure all things associated with the assignment of the image is correct. (Ie, the path/file is pulled from the correct location. Etc.)
    HISTORICALLY IH4 has never worked with the Product Image Zoom module.. Anyone who DOES have it working together has not shared the code required that makes this integration possible, and I have NEVER had the skillset to tackle this change..

    Maybe some nice volunteer (hint hint ) will at last share this most often asked about integration... I am GUESSING that this would require some kind of admin option to turn off if one isn't using the Product Image Zoom module..
    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. #1194
    Join Date
    Jul 2012
    Posts
    16,718
    Plugin Contributions
    17

    Default Re: products_image_large equivalent

    Quote Originally Posted by DivaVocals View Post
    HISTORICALLY IH4 has never worked with the Product Image Zoom module.. Anyone who DOES have it working together has not shared the code required that makes this integration possible, and I have NEVER had the skillset to tackle this change..

    Maybe some nice volunteer (hint hint ) will at last share this most often asked about integration... I am GUESSING that this would require some kind of admin option to turn off if one isn't using the Product Image Zoom module..
    Untested, but seems like may work? (Might have some offset parantheses, ie missing one or have an extra):
    file changed is: includes/templates/YOUR_TEMPLATE/templates/tpl_modules_main_product_image.php and is/was based off of the file available in ZC 1.5.3, may be different. If dimensions have been altered because of the below, then the left side of this statement:

    list($src, $alt, $width, $height, $parameters) = $newimg;

    Could be modified as necessary to omit the undesired property, for example to prevent the $width from being reassigned:
    list($src, $alt, , $height, $parameters) = $newimg;



    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>
    The second edit should account for the presence of the product image zoom code by verifying the presence of the auto_loader file in the template. If it doesn't exist, then the javascript shouldn't end up being loaded, and therefore, the zoom option/feature wouldn't work. Of course it is always possible that a javascript file could be removed as an alternative, but if the autoloader is still in place, I believe it would throw an error that it couldn't find the file(s). So seems like the best way to determine the presence of the product image zoom option. Now, if the request is/was to do the hover aspect like with other images on the page without the use of product image zoom, then that's a different story... :)

    I might get around to testing the above, but have some other things to work on.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #1195
    Join Date
    Jul 2012
    Posts
    16,718
    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...

  6. #1196
    Join Date
    Jul 2012
    Posts
    16,718
    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...

  7. #1197
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,023
    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.

  8. #1198
    Join Date
    Jul 2012
    Posts
    16,718
    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...

  9. #1199
    Join Date
    Jul 2012
    Posts
    16,718
    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...

  10. #1200
    Join Date
    Jul 2012
    Posts
    16,718
    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...

 

 

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: 582
    Last Post: 18 Feb 2024, 07:53 PM
  2. Attribute image replaces main product image on select [Support Thread]
    By exoticcorpse in forum All Other Contributions/Addons
    Replies: 158
    Last Post: 24 Aug 2020, 05:07 PM
  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

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