Results 1 to 10 of 38

Hybrid View

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

    Default Re: JS/CSS thumbnail slider for additional images

    Ok I've got it in and working automatically, more or less.

    Here is a link where you can see how it works with a bunch of images (scroll):
    http://0stage.justmedical***DOT***bi..._Test_1_Images

    Here is a link where you can see it with only a couple images (no scroll):
    http://0stage.justmedical***DOT***bi...roducts_id=159

    Here is a link no additional images:
    http://0stage.justmedical***DOT***bi...roducts_id=123

    PROBLEM: Zen is trying to apply a column display to additional images. To demonstrate, visit the first link above and scroll left.

    I suspect the problem is occurring within the file where I put my code (/includes/templates/MY_TEMPLATE/templates/tpl_modules_additional_images.php).

    I feel like I should just be able to say:
    <?php echo '<div>' . $list_box_contents . '</div>' . "\n"; ?>

    But that breaks the cart.

    Can somebody tell me how to strip out all the column/row stuff from this?

    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'));
     
    ?>
     <?php
     
    if ($flag_show_product_info_additional_images != && $num_images 0) {
      
    ?>

        <div class="responsive">

    <?php
    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'];
    ?>

    <?php
        
    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'])) {
    ?>
        <?php echo '<div>' $list_box_contents[$row][$col]['text'] .  '</div>' "\n"?>

    <?php
          
    }
        }
    ?>
    <br class="clearBoth" />
    <?php
      
    }
    }
    ?> 

        </div>

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

    Default Re: JS/CSS thumbnail slider for additional images

    you should only have to remove the <br class="clearBoth" />


    Quote Originally Posted by Feznizzle View Post
    Ok I've got it in and working automatically, more or less.

    Here is a link where you can see how it works with a bunch of images (scroll):
    http://0stage.justmedical***DOT***bi..._Test_1_Images

    Here is a link where you can see it with only a couple images (no scroll):
    http://0stage.justmedical***DOT***bi...roducts_id=159

    Here is a link no additional images:
    http://0stage.justmedical***DOT***bi...roducts_id=123

    PROBLEM: Zen is trying to apply a column display to additional images. To demonstrate, visit the first link above and scroll left.

    I suspect the problem is occurring within the file where I put my code (/includes/templates/MY_TEMPLATE/templates/tpl_modules_additional_images.php).

    I feel like I should just be able to say:
    <?php echo '<div>' . $list_box_contents . '</div>' . "\n"; ?>

    But that breaks the cart.

    Can somebody tell me how to strip out all the column/row stuff from this?

    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'));
     
    ?>
     <?php
     
    if ($flag_show_product_info_additional_images != && $num_images 0) {
      
    ?>

        <div class="responsive">

    <?php
    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'];
    ?>

    <?php
        
    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'])) {
    ?>
        <?php echo '<div>' $list_box_contents[$row][$col]['text'] .  '</div>' "\n"?>

    <?php
          
    }
        }
    ?>
    <br class="clearBoth" />
    <?php
      
    }
    }
    ?> 

        </div>

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

    Default Re: JS/CSS thumbnail slider for additional images

    Quote Originally Posted by rbarbour View Post
    you should only have to remove the <br class="clearBoth" />
    rbarbour for PRESIDENT!!!!!

    Wooooo hoooooo!

    That has driven me nuts for hours!

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

    Default Re: JS/CSS thumbnail slider for additional images

    This (I believe) is my last battle to fight!

    Now I am trying to reduce wasted space while keeping my product image and any additional images (1-3) flush left.

    Referring back to the last of the three links to my site above, you can see I've managed to do that. If you browse around, you will see that all products with only one image are floating left.

    Once an additional image is added, width gets added and my main product image centers above width.

    But I would like the width to change ONLY if the scroll effect is called.

    Notice the margin on the left when only 1 or 2 additional images appear (less than 4, which calls the scroll effect)? That margin is a place holder for the buttons. How do I kill it?

    Here is my css...
    PHP Code:



    /* Slider ORIGINAL */
    .slick-slider
    {
        
    positionrelative;
        
    padding-left35px;

        
    displayblock;
        
    width:100%;

        -
    moz-box-sizingborder-box;
             
    box-sizingborder-box;

        -
    webkit-user-selectnone;
           -
    moz-user-selectnone;
            -
    ms-user-selectnone;
                
    user-selectnone;

        -
    webkit-touch-calloutnone;
        -
    khtml-user-selectnone;
        -
    ms-touch-actionpan-y;
            
    touch-actionpan-y;
        -
    webkit-tap-highlight-colortransparent;
    }

    .
    slick-list
    {
        
    positionrelative;

        
    displayblock;
        
    overflowhidden;
        
    width:190px;
        

        
    margin0;
        
    padding0;
    }
    .
    slick-list:focus
    {
        
    outlinenone;
    }
    .
    slick-list.dragging
    {
        
    cursorpointer;
        
    cursorhand;
    }

    .
    slick-slider .slick-track,
    .
    slick-slider .slick-list
    {
        -
    webkit-transformtranslate3d(000);
           -
    moz-transformtranslate3d(000);
            -
    ms-transformtranslate3d(000);
             -
    o-transformtranslate3d(000);
                
    transformtranslate3d(000);
    }

    .
    slick-track
    {
        
    positionrelative;
        
    top0;
        
    left0;

        
    displayblock;
    }
    .
    slick-track:before,
    .
    slick-track:after
    {
        
    displaytable;

        
    content'';
    }
    .
    slick-track:after
    {
        
    clearboth;
    }
    .
    slick-loading .slick-track
    {
        
    visibilityhidden;
    }

    .
    slick-slide
    {
        
    displaynone;
        
    floatleft;

        
    height100%;
        
    min-height1px;
        
    padding-bottom5px;
    }
    [
    dir='rtl'] .slick-slide
    {
        
    floatright;
    }
    .
    slick-slide img
    {
        
    displayblock;
    }
    .
    slick-slide.slick-loading img
    {
        
    displaynone;
    }
    .
    slick-slide.dragging img
    {
        
    pointer-eventsnone;
    }
    .
    slick-initialized .slick-slide
    {
        
    displayblock;
    }
    .
    slick-loading .slick-slide
    {
        
    visibilityhidden;
    }
    .
    slick-vertical .slick-slide
    {
        
    displayblock;

        
    heightauto;

        
    border1px solid transparent;
    }
    .
    slick-arrow.slick-hidden {
        
    displaynone;
    }

    /* Slider THEME */
    .slick-loading .slick-list
    {
        
    background#fff url('./ajax-loader.gif') center center no-repeat;
    }

    /* Icons */
    @font-face
    {
        
    font-family'slick';
        
    font-weightnormal;
        
    font-stylenormal;

        
    srcurl('./fonts/slick.eot');
        
    srcurl('./fonts/slick.eot?#iefix'format('embedded-opentype'), url('./fonts/slick.woff'format('woff'), url('./fonts/slick.ttf'format('truetype'), url('./fonts/slick.svg#slick'format('svg');
    }
    /* Arrows */
    .slick-prev,
    .
    slick-next
    {
        
    font-size0;
        
    font-weightbold;
        
    line-height0;

        
    positionabsolute;
        
    top50%;

        
    displayblock;

        
    width30px;
        
    height30px;
        
    padding0;
        
    margin-top: -10px\9/*lte IE 8*/
        
    -webkit-transformtranslate(0, -50%);
        -
    ms-transformtranslate(0, -50%);
        
    transformtranslate(0, -50%);

        
    cursorpointer;

        
    colortransparent;
        
    border-radius50%;
        
    border1px solid #d2d2d2;
        
    outlinenone;
        
    background#24618E;
    }
    .
    slick-prev:hover,
    .
    slick-prev:focus,
    .
    slick-next:hover,
    .
    slick-next:focus
    {
        
    colortransparent;
        
    border-radius50%;
        
    outlinenone;
        
    background#24618E;
    }
    .
    slick-prev:hover:before,
    .
    slick-prev:focus:before,
    .
    slick-next:hover:before,
    .
    slick-next:focus:before
    {
        
    opacity1;
    }
    .
    slick-prev.slick-disabled:before,
    .
    slick-next.slick-disabled:before
    {
        
    opacity.25;
    }

    .
    slick-prev:before,
    .
    slick-next:before
    {
        
    font-family'slick';
        
    font-size20px;
        
    font-weightbold;
        
    line-height1;

        
    opacity.75;
        
    colorwhite;

        -
    webkit-font-smoothingantialiased;
        -
    moz-osx-font-smoothinggrayscale;
    }

    .
    slick-prev
    {
        
    left0px;
    }
    [
    dir='rtl'] .slick-prev
    {
        
    right: -25px;
        
    leftauto;
    }
    .
    slick-prev:before
    {
        
    content'<';
    }
    [
    dir='rtl'] .slick-prev:before
    {
        
    content'>';
    }

    .
    slick-next
    {
        
    right: -1px;
    }
    [
    dir='rtl'] .slick-next
    {
        
    rightauto;
        
    left: -25px;
    }
    .
    slick-next:before
    {
        
    content'>';
    }
    [
    dir='rtl'] .slick-next:before
    {
        
    content'<';
    }

    /* Dots
    .slick-slider
    {
        margin-bottom: 30px;
    }

    .slick-dots
    {
        position: absolute;
        bottom: -45px;

        display: block;

        width: 100%;
        padding: 0;

        list-style: none;

        text-align: center;
    }
    .slick-dots li
    {
        position: relative;

        display: inline-block;

        width: 20px;
        height: 20px;
        margin: 0 5px;
        padding: 0;

        cursor: pointer;
    }
    .slick-dots li button
    {
        font-size: 0;
        line-height: 0;

        display: block;

        width: 20px;
        height: 20px;
        padding: 5px;

        cursor: pointer;

        color: transparent;
        border: 0;
        outline: none;
        background: transparent;
    }
    .slick-dots li button:hover,
    .slick-dots li button:focus
    {
        outline: none;
    }
    .slick-dots li button:hover:before,
    .slick-dots li button:focus:before
    {
        opacity: 1;
    }
    .slick-dots li button:before
    {
        font-family: 'slick';
        font-size: 6px;
        line-height: 20px;

        position: absolute;
        top: 0;
        left: 0;

        width: 20px;
        height: 20px;

        content: '•';
        text-align: center;

        opacity: .25;
        color: black;

        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    .slick-dots li.slick-active button:before
    {
        opacity: .75;
        color: black;
    }
     */ 

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

    Default Re: JS/CSS thumbnail slider for additional images

    Not exactly sure what your asking

    Can you send screenshots

    Quote Originally Posted by Feznizzle View Post
    This (I believe) is my last battle to fight!

    Now I am trying to reduce wasted space while keeping my product image and any additional images (1-3) flush left.

    Referring back to the last of the three links to my site above, you can see I've managed to do that. If you browse around, you will see that all products with only one image are floating left.

    Once an additional image is added, width gets added and my main product image centers above width.

    But I would like the width to change ONLY if the scroll effect is called.

    Notice the margin on the left when only 1 or 2 additional images appear (less than 4, which calls the scroll effect)? That margin is a place holder for the buttons. How do I kill it?

    Here is my css...
    PHP Code:



    /* Slider ORIGINAL */
    .slick-slider
    {
        
    positionrelative;
        
    padding-left35px;

        
    displayblock;
        
    width:100%;

        -
    moz-box-sizingborder-box;
             
    box-sizingborder-box;

        -
    webkit-user-selectnone;
           -
    moz-user-selectnone;
            -
    ms-user-selectnone;
                
    user-selectnone;

        -
    webkit-touch-calloutnone;
        -
    khtml-user-selectnone;
        -
    ms-touch-actionpan-y;
            
    touch-actionpan-y;
        -
    webkit-tap-highlight-colortransparent;
    }

    .
    slick-list
    {
        
    positionrelative;

        
    displayblock;
        
    overflowhidden;
        
    width:190px;
        

        
    margin0;
        
    padding0;
    }
    .
    slick-list:focus
    {
        
    outlinenone;
    }
    .
    slick-list.dragging
    {
        
    cursorpointer;
        
    cursorhand;
    }

    .
    slick-slider .slick-track,
    .
    slick-slider .slick-list
    {
        -
    webkit-transformtranslate3d(000);
           -
    moz-transformtranslate3d(000);
            -
    ms-transformtranslate3d(000);
             -
    o-transformtranslate3d(000);
                
    transformtranslate3d(000);
    }

    .
    slick-track
    {
        
    positionrelative;
        
    top0;
        
    left0;

        
    displayblock;
    }
    .
    slick-track:before,
    .
    slick-track:after
    {
        
    displaytable;

        
    content'';
    }
    .
    slick-track:after
    {
        
    clearboth;
    }
    .
    slick-loading .slick-track
    {
        
    visibilityhidden;
    }

    .
    slick-slide
    {
        
    displaynone;
        
    floatleft;

        
    height100%;
        
    min-height1px;
        
    padding-bottom5px;
    }
    [
    dir='rtl'] .slick-slide
    {
        
    floatright;
    }
    .
    slick-slide img
    {
        
    displayblock;
    }
    .
    slick-slide.slick-loading img
    {
        
    displaynone;
    }
    .
    slick-slide.dragging img
    {
        
    pointer-eventsnone;
    }
    .
    slick-initialized .slick-slide
    {
        
    displayblock;
    }
    .
    slick-loading .slick-slide
    {
        
    visibilityhidden;
    }
    .
    slick-vertical .slick-slide
    {
        
    displayblock;

        
    heightauto;

        
    border1px solid transparent;
    }
    .
    slick-arrow.slick-hidden {
        
    displaynone;
    }

    /* Slider THEME */
    .slick-loading .slick-list
    {
        
    background#fff url('./ajax-loader.gif') center center no-repeat;
    }

    /* Icons */
    @font-face
    {
        
    font-family'slick';
        
    font-weightnormal;
        
    font-stylenormal;

        
    srcurl('./fonts/slick.eot');
        
    srcurl('./fonts/slick.eot?#iefix'format('embedded-opentype'), url('./fonts/slick.woff'format('woff'), url('./fonts/slick.ttf'format('truetype'), url('./fonts/slick.svg#slick'format('svg');
    }
    /* Arrows */
    .slick-prev,
    .
    slick-next
    {
        
    font-size0;
        
    font-weightbold;
        
    line-height0;

        
    positionabsolute;
        
    top50%;

        
    displayblock;

        
    width30px;
        
    height30px;
        
    padding0;
        
    margin-top: -10px\9/*lte IE 8*/
        
    -webkit-transformtranslate(0, -50%);
        -
    ms-transformtranslate(0, -50%);
        
    transformtranslate(0, -50%);

        
    cursorpointer;

        
    colortransparent;
        
    border-radius50%;
        
    border1px solid #d2d2d2;
        
    outlinenone;
        
    background#24618E;
    }
    .
    slick-prev:hover,
    .
    slick-prev:focus,
    .
    slick-next:hover,
    .
    slick-next:focus
    {
        
    colortransparent;
        
    border-radius50%;
        
    outlinenone;
        
    background#24618E;
    }
    .
    slick-prev:hover:before,
    .
    slick-prev:focus:before,
    .
    slick-next:hover:before,
    .
    slick-next:focus:before
    {
        
    opacity1;
    }
    .
    slick-prev.slick-disabled:before,
    .
    slick-next.slick-disabled:before
    {
        
    opacity.25;
    }

    .
    slick-prev:before,
    .
    slick-next:before
    {
        
    font-family'slick';
        
    font-size20px;
        
    font-weightbold;
        
    line-height1;

        
    opacity.75;
        
    colorwhite;

        -
    webkit-font-smoothingantialiased;
        -
    moz-osx-font-smoothinggrayscale;
    }

    .
    slick-prev
    {
        
    left0px;
    }
    [
    dir='rtl'] .slick-prev
    {
        
    right: -25px;
        
    leftauto;
    }
    .
    slick-prev:before
    {
        
    content'<';
    }
    [
    dir='rtl'] .slick-prev:before
    {
        
    content'>';
    }

    .
    slick-next
    {
        
    right: -1px;
    }
    [
    dir='rtl'] .slick-next
    {
        
    rightauto;
        
    left: -25px;
    }
    .
    slick-next:before
    {
        
    content'>';
    }
    [
    dir='rtl'] .slick-next:before
    {
        
    content'<';
    }

    /* Dots
    .slick-slider
    {
        margin-bottom: 30px;
    }

    .slick-dots
    {
        position: absolute;
        bottom: -45px;

        display: block;

        width: 100%;
        padding: 0;

        list-style: none;

        text-align: center;
    }
    .slick-dots li
    {
        position: relative;

        display: inline-block;

        width: 20px;
        height: 20px;
        margin: 0 5px;
        padding: 0;

        cursor: pointer;
    }
    .slick-dots li button
    {
        font-size: 0;
        line-height: 0;

        display: block;

        width: 20px;
        height: 20px;
        padding: 5px;

        cursor: pointer;

        color: transparent;
        border: 0;
        outline: none;
        background: transparent;
    }
    .slick-dots li button:hover,
    .slick-dots li button:focus
    {
        outline: none;
    }
    .slick-dots li button:hover:before,
    .slick-dots li button:focus:before
    {
        opacity: 1;
    }
    .slick-dots li button:before
    {
        font-family: 'slick';
        font-size: 6px;
        line-height: 20px;

        position: absolute;
        top: 0;
        left: 0;

        width: 20px;
        height: 20px;

        content: '•';
        text-align: center;

        opacity: .25;
        color: black;

        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    .slick-dots li.slick-active button:before
    {
        opacity: .75;
        color: black;
    }
     */ 

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

    Default Re: JS/CSS thumbnail slider for additional images

    Hard to word it, sry.

    I'm trying to kill the space to the right of product images in screenshot.
    Click image for larger version. 

Name:	Screen Shot 2016-03-27 at 8.24.54 PM.png 
Views:	153 
Size:	81.7 KB 
ID:	16165

    My additional images are set to 50px max. I'd like this thing to increase width of ".responsive" by 60px (50px for image, plus 10px margin-right) per each additional product image. So before it hits the forth image (triggering slider button), it would max out at 180px (3 images @ 60px).

    Make sense?

    Btw, I have decided to figure out how to kill the left button.
    Last edited by Feznizzle; 28 Mar 2016 at 01:38 AM. Reason: oh yeah

  7. #7
    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>';
     }

    ?>

 

 

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