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

    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...

  2. #2
    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...

  3. #3
    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...

  4. #4
    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.

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

    Default Re: products_image_large equivalent

    Quote Originally Posted by nipinuk View Post
    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.
    The code of: http://www.zen-cart.com/showthread.p...52#post1263152
    Is based on the downloadable product image zoom from the downloads section. What I had to do to get that "program" to work or force it to work was to move the javascript files out of their special little directory and place them with the other jscript files just off of the template's main folder. I then prefixed the files to load I think with jscript_. There are less forceful ways to do this, but with those files loaded and the provided code for themain image, product image zoom does work.

    Now if you use the IH4 zoom on hover over small images feature then the code at: http://www.zen-cart.com/showthread.p...34#post1263234
    Would be more appropriate if the product's image (medium sized image) is the same as both the small image and the large image, or if the large image is relatively repesentative of the product image being displayed.

    Other than that, I can't see why more questions aren't asked instead of surrendering to doing more work than is necessary to run your store.

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

    Default Re: products_image_large equivalent

    Quote Originally Posted by mc12345678 View Post
    The code of: http://www.zen-cart.com/showthread.p...52#post1263152
    Is based on the downloadable product image zoom from the downloads section. What I had to do to get that "program" to work or force it to work was to move the javascript files out of their special little directory and place them with the other jscript files just off of the template's main folder. I then prefixed the files to load I think with jscript_. There are less forceful ways to do this, but with those files loaded and the provided code for themain image, product image zoom does work.

    Now if you use the IH4 zoom on hover over small images feature then the code at: http://www.zen-cart.com/showthread.p...34#post1263234
    Would be more appropriate if the product's image (medium sized image) is the same as both the small image and the large image, or if the large image is relatively repesentative of the product image being displayed.

    Other than that, I can't see why more questions aren't asked instead of surrendering to doing more work than is necessary to run your store.
    Looking at what I did to make this work, I see that I didn't follow the instructions of installing css/js loader... I thought the lasttime I did that, I got more than I wanted/needed... Needless to say atthat time I uninstalled the application, until I would find a must need for it and as necessary keep/omit the aspects I wanted to have. Seems like it would accomplish the loading of the javascript to apply to the product(s) as necessary based on the auto_loader cll, though if you use a product type other than just product, the autoloder would have to be modified to apply to each applicable product type used/to which to apply the product image zoom code.
    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

    Sorry I was feeling completely overwhelmed! I'm looking at it again as you're right, I shouldn't just surrender so quickly :)

    Here's what I've done and where I got stuck
    1. move the following files from includes/templates/mytemplate/jscript/jquery to includes/templates/mytemplate/jscript
    jquery.elevateZoom-3.0.8.min.js
    jquery_product_image_zoom.js
    jquery-1.10.2.min.js

    2. 'prefixed the files to load I think with jscript_' - I got stuck here. How would you prefix the files to load? I tried looking into the script of the files mentioned but don't know which line or file to ammend. Which file/s would I need to ammend?

    I just read your latest post. I need CSS JS Loader as I'm using the Fast and Easy Checkout plugin. I don't think I'll be using any other product type other than just product thank goodness!

    Thank you for all your help mc12345678

  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