Results 1 to 10 of 38

Hybrid View

  1. #1
    Join Date
    Feb 2010
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: JS/CSS thumbnail slider for additional images

    Make these changes first, this basically only adds <div class="responsive"> if more than 3 additional images

    PHP Code:
    <?php
    /**
     * Module Template:
     * Loaded by product-type template to display additional product images.
     *
     * @package templateSystem
     * @copyright Copyright 2003-2005 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_additional_images.php 3215 2006-03-20 06:05:55Z birdbrain $
     * 
     */

     
    require(DIR_WS_MODULES zen_get_module_directory('additional_images.php'));

     if (
    $num_images 3) {
     echo 
    '<div class="responsive">';
     }

     if (
    $flag_show_product_info_additional_images != && $num_images 0) {

    if (
    is_array($list_box_contents) > ) {
     for(
    $row=0;$row<sizeof($list_box_contents);$row++) {
        
    $params "";
        
    //if (isset($list_box_contents[$row]['params'])) $params .= ' ' . $list_box_contents[$row]['params'];

        
    for($col=0;$col<sizeof($list_box_contents[$row]);$col++) {
          
    $r_params "";
          if (isset(
    $list_box_contents[$row][$col]['params'])) $r_params .= ' ' . (string)$list_box_contents[$row][$col]['params'];
         if (isset(
    $list_box_contents[$row][$col]['text'])) {

    echo 
    '<div>' $list_box_contents[$row][$col]['text'] .  '</div>'


          }
        }
      }
    }

      }

     if (
    $num_images 3) {
     echo 
    '</div>';
     }

    ?>

  2. #2
    Join Date
    Apr 2010
    Posts
    900
    Plugin Contributions
    0

    Default Re: JS/CSS thumbnail slider for additional images

    Crud, I deleted my back up tpl_modules_additional_images.php from right before you gave me the new code!

    Anyway, I had my js inside of that file. Not sure how I had it cuz I can't seem to replicate it now.

    Below is the last way I tried it. Breaks the page. Can you show me how to work it back in?


    PHP Code:

    <?php 
    /** 
     * Module Template: 
     * Loaded by product-type template to display additional product images. 
     * 
     * @package templateSystem 
     * @copyright Copyright 2003-2005 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_additional_images.php 3215 2006-03-20 06:05:55Z birdbrain $ 
     *  
     */ 

     
    require(DIR_WS_MODULES zen_get_module_directory('additional_images.php')); 

     if (
    $num_images 3) { 
     echo 
    '<div class="responsive">'
     
     
     <
    script type="text/javascript">
    (function($) {
    $(
    document).ready(function() {

    $(
    '.responsive').slick({
    dotsfalse,
    infinitetrue,
    speed300,
    slidesToShow3,
    slidesToScroll3,
    responsive: [
    {
    breakpoint1024,
    settings: {
    slidesToShow3,
    slidesToScroll3,
    infinitetrue,
    dotstrue
    }
    },
    {
    breakpoint600,
    settings: {
    slidesToShow1,
    slidesToScroll1
    }
    },
    {
    breakpoint480,
    settings: {
    slidesToShow1,
    slidesToScroll1
    }
    }
    // You can unslick at a given breakpoint now by adding:
    // settings: "unslick"
    // instead of a settings object
    ]
    });

    });

    }) (
    jQuery);
    </script>
     
     
     
     } 

     if ($flag_show_product_info_additional_images != 0 && $num_images > 0) { 

    if (is_array($list_box_contents) > 0 ) { 
     for($row=0;$row<sizeof($list_box_contents);$row++) { 
        $params = ""; 
        //if (isset($list_box_contents[$row]['params'])) $params .= ' ' . $list_box_contents[$row]['params']; 

        for($col=0;$col<sizeof($list_box_contents[$row]);$col++) { 
          $r_params = ""; 
          if (isset($list_box_contents[$row][$col]['params'])) $r_params .= ' ' . (string)$list_box_contents[$row][$col]['params']; 
         if (isset($list_box_contents[$row][$col]['text'])) { 

    echo '<div>' . $list_box_contents[$row][$col]['text'] .  '</div>';  


          } 
        } 
      } 


      } 

     if ($num_images > 3) { 
     echo '</div>'; 
     } 

    ?>

  3. #3
    Join Date
    Feb 2010
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: JS/CSS thumbnail slider for additional images

    unless you have something other than what I can see in this file just copy my code and paste it in

    PHP Code:
     <?php
    /**
     * Module Template:
     * Loaded by product-type template to display additional product images.
     *
     * @package templateSystem
     * @copyright Copyright 2003-2005 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_additional_images.php 3215 2006-03-20 06:05:55Z birdbrain $
     * 
     */

     
    require(DIR_WS_MODULES zen_get_module_directory('additional_images.php'));

     if (
    $flag_show_product_info_additional_images != && $num_images 0) {

     if (
    $num_images 3) {
     echo 
    '<div class="responsive">';
     }

    if (
    is_array($list_box_contents) > ) {
     for(
    $row=0;$row<sizeof($list_box_contents);$row++) {
        
    $params "";
        
    //if (isset($list_box_contents[$row]['params'])) $params .= ' ' . $list_box_contents[$row]['params'];

        
    for($col=0;$col<sizeof($list_box_contents[$row]);$col++) {
          
    $r_params "";
          if (isset(
    $list_box_contents[$row][$col]['params'])) $r_params .= ' ' . (string)$list_box_contents[$row][$col]['params'];
         if (isset(
    $list_box_contents[$row][$col]['text'])) {

    echo 
    '<div>' $list_box_contents[$row][$col]['text'] .  '</div>'


          }
        }
      }
    }

     if (
    $num_images 3) {
     echo 
    '</div>';
     }

      }
    ?> 

    <script type="text/javascript">
    (function($) {
    $(document).ready(function() {

    $('.responsive').slick({
    dots: false,
    infinite: true,
    speed: 300,
    slidesToShow: 3,
    slidesToScroll: 3,
    responsive: [
    {
    breakpoint: 1024,
    settings: {
    slidesToShow: 3,
    slidesToScroll: 3,
    infinite: true,
    dots: true
    }
    },
    {
    breakpoint: 600,
    settings: {
    slidesToShow: 1,
    slidesToScroll: 1
    }
    },
    {
    breakpoint: 480,
    settings: {
    slidesToShow: 1,
    slidesToScroll: 1
    }
    }
    // You can unslick at a given breakpoint now by adding:
    // settings: "unslick"
    // instead of a settings object
    ]
    });

    });

    }) (jQuery);
    </script>
    Quote Originally Posted by Feznizzle View Post
    Crud, I deleted my back up tpl_modules_additional_images.php from right before you gave me the new code!

    Anyway, I had my js inside of that file. Not sure how I had it cuz I can't seem to replicate it now.

    Below is the last way I tried it. Breaks the page. Can you show me how to work it back in?

  4. #4
    Join Date
    Apr 2010
    Posts
    900
    Plugin Contributions
    0

    Default Re: JS/CSS thumbnail slider for additional images

    Working again, ty!

    It's stacking additional images when no scroll is triggered (less than 4 additional images).

    Gonna try to figure that out b4 bed...

    One more thing though! How do I kill that left scroll button?

  5. #5
    Join Date
    Apr 2010
    Posts
    900
    Plugin Contributions
    0

    Default Re: JS/CSS thumbnail slider for additional images

    Pretty sure I need that "clear both" that I deleted previously, since we now have additional images standing alone if no scroll. Just can't figure out where.

  6. #6
    Join Date
    Feb 2010
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: JS/CSS thumbnail slider for additional images

    OK lets finish it up:

    2 changes, adds div with stock class if less than 3 images

    PHP Code:
    <?php
    /**
     * Module Template:
     * Loaded by product-type template to display additional product images.
     *
     * @package templateSystem
     * @copyright Copyright 2003-2005 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_additional_images.php 3215 2006-03-20 06:05:55Z birdbrain $
     * 
     */

     
    require(DIR_WS_MODULES zen_get_module_directory('additional_images.php'));

     if (
    $flag_show_product_info_additional_images != && $num_images 0) {

     if (
    $num_images 3) {
     echo 
    '<div class="responsive">';
     } else {
     echo 
    '<div id="productAdditionalImages">';
     }

    if (
    is_array($list_box_contents) > ) {
     for(
    $row=0;$row<sizeof($list_box_contents);$row++) {
        
    $params "";
        
    //if (isset($list_box_contents[$row]['params'])) $params .= ' ' . $list_box_contents[$row]['params'];

        
    for($col=0;$col<sizeof($list_box_contents[$row]);$col++) {
          
    $r_params "";
          if (isset(
    $list_box_contents[$row][$col]['params'])) $r_params .= ' ' . (string)$list_box_contents[$row][$col]['params'];
         if (isset(
    $list_box_contents[$row][$col]['text'])) {

    echo 
    '<div class="centeredContent">' $list_box_contents[$row][$col]['text'] .  '</div>'


          }
        }
      }
    }


     echo 
    '</div>';
      }
    ?>  
    <script type="text/javascript">
    (function($) {
    $(document).ready(function() {

    $('.responsive').slick({
    dots: false,
    infinite: true,
    speed: 300,
    slidesToShow: 3,
    slidesToScroll: 3,
    responsive: [
    {
    breakpoint: 1024,
    settings: {
    slidesToShow: 3,
    slidesToScroll: 3,
    infinite: true,
    dots: true
    }
    },
    {
    breakpoint: 600,
    settings: {
    slidesToShow: 1,
    slidesToScroll: 1
    }
    },
    {
    breakpoint: 480,
    settings: {
    slidesToShow: 1,
    slidesToScroll: 1
    }
    }
    // You can unslick at a given breakpoint now by adding:
    // settings: "unslick"
    // instead of a settings object
    ]
    });

    });

    }) (jQuery);
    </script>
    in the jscript file for the slider find:
    PHP Code:
                    prevArrow'<button type="button" data-role="none" class="slick-prev" aria-label="Previous" tabindex="0" role="button"><i class="fa fa-angle-double-left"></i></button>'
    change to:
    PHP Code:
                    prevArrow''
    or add
    Code:
    .slick-prev { display:none; }
    to bottom of slider css file


    Quote Originally Posted by Feznizzle View Post
    Working again, ty!

    It's stacking additional images when no scroll is triggered (less than 4 additional images).

    Gonna try to figure that out b4 bed...

    One more thing though! How do I kill that left scroll button?

  7. #7
    Join Date
    Apr 2010
    Posts
    900
    Plugin Contributions
    0

    Default Re: JS/CSS thumbnail slider for additional images

    Awesomeness!!

    One last minor glitch. When no scroll is triggered, the additional images stack. Here is a link:
    http://0stage.justmedical***DOT***bi...roducts_id=159

    I'm pretty sure that goes back to this:
    https://www.zen-cart.com/showthread....60#post1307260

    Now that you have separated out the js, seems like the clear both needs to get put back into the group that does not receive js?

    I just can't figure where...

  8. #8
    Join Date
    Feb 2010
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: JS/CSS thumbnail slider for additional images

    Did you alter the additional_images.php modules file?

    /includes/modules/zca_responsive_classic/additional_images.php

    seems to be missing the stock class"class="additionalImages centeredContent back"

    Quote Originally Posted by Feznizzle View Post
    Awesomeness!!

    One last minor glitch. When no scroll is triggered, the additional images stack. Here is a link:
    http://0stage.justmedical***DOT***bi...roducts_id=159

    I'm pretty sure that goes back to this:
    https://www.zen-cart.com/showthread....60#post1307260

    Now that you have separated out the js, seems like the clear both needs to get put back into the group that does not receive js?

    I just can't figure where...

 

 

Similar Threads

  1. Additional images jquery mini-slider --- is it possible?
    By Invizix in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 17 Sep 2012, 12:48 PM
  2. Main Image Thumbnail Appear With Additional Images
    By cv733 in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 24 Jan 2011, 08:38 PM
  3. How do I show the main image as a thumbnail with the additional images?
    By rikahsdesign in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 24 Jan 2011, 03:45 AM
  4. CSS & additional images
    By Paris in forum Templates, Stylesheets, Page Layout
    Replies: 12
    Last Post: 30 Aug 2007, 11:42 PM
  5. Define thumbnail for large product images?
    By shirster in forum General Questions
    Replies: 4
    Last Post: 29 Apr 2007, 06:19 AM

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