Thumbnail size in sliderProducts plugin

Guido

Avatar: Guido

2013-09-10 19:03

Hi,

I'm using the sliderProducts plugin and want to display (much) larger thumbnails. Currently it's using the default thumbnail size I have set on productpage.

How do I display the original size of the picture in this slider?

Guido

» Quick.Cart v6.x

openzibi

Avatar: openzibi

2013-09-10 20:11

Something like this http://www.okionline.pl ? (Today only on Promocje) There are different thumbnails on slider and products list.

StudioStrona - rhh.pl

Guido

Avatar: Guido

2013-09-10 20:56

Yes, I notice different thumbnail sizes in product list and in slider.
So how did you add the bigger thumbnail to te product slider?

Guido

openzibi

Avatar: openzibi

2013-09-11 09:52

This is a shop EXT version. I can give you only a short description.
Slider uses getDefaultImage function. You can change the function or do a copy with the new name.
You can change the iSizeValue1 to iSizeValue2 in new function.
SizeValue2 must be 150 or greater.(180,200 etc)
In addition, in several places in style.css add max-height: 150px; max-width: 150px

StudioStrona - rhh.pl

Guido

Avatar: Guido

2013-09-11 15:00

Thanks, I notice the getDefaultImage function code.
You know how to get original size of the image in stead of adding/changing (default) thumbnail image-size?
I mean, what to add in stead of 'getDefaultImage'

Then I can set my own width/height in css file.

Guido

openzibi

Avatar: openzibi

2013-09-11 22:11

Why don't you create a copy of getDefaultImage function?
Name it: DefaultImageSlider. Call to thi function in function listProductsSlider (core/products.php)
Do not want to use second thumbnail? Ok, in function DefaultImageSlider delete this: $this->aImagesDefault[$iLinkType][$iLink]['iSizeValue2'].

StudioStrona - rhh.pl

Guido

Avatar: Guido

2013-09-12 09:56

Thanks.
When I set new default thumbnail image size in general.php, I must save product first in order to create thumbnail.
Because I want to use different size for product and for slider, I prefer to use the original image size in this plugin (core/products.php).

Guido

Guido

Avatar: Guido

2013-09-13 15:17

@openzibi, thanks a lot > I understand it now :-)!

0) I've installed the plugin sliderProducts

1) I've added this in file core/files.php:


  
/**
  * Display slider image
  * @return string
  * @param int $iLink
  * @param int $iLinkType
  * @param bool $bLinks
  * @param string $sLink
  */
  
function getSliderImage$iLink$iLinkType 1$bLinks null$sLink null ){
    if( isset( 
$this->aImagesDefault[$iLinkType][$iLink] ) ){
      if( isset( 
$bLinks ) ){
        
$sLink = isset( $sLink ) ? '<a href="'.$sLink.'">' '<a href="'.$GLOBALS['config']['dir_files'].$this->aImagesDefault[$iLinkType][$iLink]['sFileName'].'" class="mlbox[images]">';
      }
      return 
'<div class="photo">'.$sLink.'<img src="'.$GLOBALS['config']['dir_files'].$this->aImagesDefault[$iLinkType][$iLink]['iSizeValue3'].'/'.$this->aImagesDefault[$iLinkType][$iLink]['sFileName'].'" alt="'.( isset( $this->aImagesDefault[$iLinkType][$iLink]['sDescription'] ) ? $this->aImagesDefault[$iLinkType][$iLink]['sDescription'] : $this->aImagesDefault[$iLinkType][$iLink]['sFileName'] ).'" />'.( isset( $bLinks ) ? '</a>' null ).'</div>';
    }
  } 
// end function getSliderImage



2) I've added extra image size in general.php:


$config
['images_sizes'] = array ( => 75=> 150=> 180=> 450 );



3) I've changed getDefaultImage into getSliderImage in file core/products.php

4) I've added this in stylesheet:


#productsSlider div.slides .photo img{max-width:450px;max-height:450px;}



That's it!

Guido

Avatar: Guido

2013-09-13 16:54

Forgot this, added this in code of sliderProducts in file _header.php:


width
"450"
height"500",



Guido

openzibi

Avatar: openzibi

2013-09-13 17:53

Point 3: ...... in function listProductsSlider.

StudioStrona - rhh.pl

Guido

Avatar: Guido

2013-09-14 12:00

You are right :-):

3) I've changed getDefaultImage into getSliderImage in file core/products.php (underneath function listProductsSlider)

4) I've added this in stylesheet:


#productsSlider div.slides .photo img{max-width:450px;max-height:450px;}



5) Added this in code of sliderProducts in file _header.php:


width
"450"
height"500",



Guido

Back to top
about us | contact