Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Zooming Thumbnail images in Xcart 3.4.0

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 05-24-2003, 12:29 PM
  leed's Avatar 
leed leed is offline
 

Senior Member
  
Join Date: Nov 2002
Location: England (UK)
Posts: 128
 

Default Zooming Thumbnail images in Xcart 3.4.0

Our customer site has a requirement for visually impaired users to be able to magnify thumbnails to a larger size.
A Q & D way of doing this is to amend product_thumbnail.tpl (skin1 directory) to use IE's zoom functionaility (only works in IE5.5 & above - sorry).

Original product_thumbnail.tpl :

{* $Id: product_thumbnail.tpl,v 1.8 2003/04/24 09:50:33 svowl Exp $ *}
{if $config.Appearance.show_thumbnails eq "Y"}[img]{if $full_url}{$http_location}{else}..{/if}/image.php?productid={$productid}{if $file_upload_data.file_path}&tmp=y{/if}[/img]{/if}

All on one line - YUK!!

So amended to be more readable :

{* $Id: product_thumbnail.tpl,v 1.8 2003/04/24 09:50:33 svowl Exp $ *}
{if $config.Appearance.show_thumbnails eq "Y"}
<img src="{if $full_url}{$http_location}{else}..{/if}/image.php?productid={$productid}
{if $file_upload_data.file_path}&tmp=y{/if}"
{if $image_x ne 0} width={$image_x}{/if}
{if $image_y ne 0} height={$image_y}{/if}
alt="{$product}" border=0>
{/if}


Now add the zoom function just before the border attribute (just above last {/if}
so ..code becomes

{* $Id: product_thumbnail.tpl,v 1.8 2003/04/24 09:50:33 svowl Exp $ *}
{if $config.Appearance.show_thumbnails eq "Y"}
<img src="{if $full_url}{$http_location}{else}..{/if}/image.php?productid={$productid}
{if $file_upload_data.file_path}&tmp=y{/if}"
{if $image_x ne 0} width={$image_x}{/if}
{if $image_y ne 0} height={$image_y}{/if}
alt="{$product}" onmouseover="this.style.zoom='300%'" onmouseout="this.style.zoom='normal'" border=0>
{/if}

You can make the zoom whatever % increase you like (image quality degrades rapidly much above 200%).

With a bit of thought, it'd be possible to use Javascript to make this applicable to other browsers.

Well...it's a start ....enjoy!


Lee D
__________________
Why a mouse when it spins ......
X-Cart Gunslingers - For Hire!!
http://forum.x-cart.com/viewtopic.php?t=8615
Reply With Quote
  #2  
Old 05-30-2003, 09:33 AM
  groovico's Avatar 
groovico groovico is offline
 

X-Man
  
Join Date: Apr 2003
Location: Firetanksoftware.com
Posts: 2,326
 

Default

Groovy simple mod, tecnically you can add a bit extra in there so the image grows to 300% too which is also a cool feature. Fantastic for breaking the display though!

Anyone seen the ZOOM in opera? Now that's how I.E should have done it!
Reply With Quote
  #3  
Old 05-30-2003, 09:11 PM
 
jpsowin jpsowin is offline
 

X-Adept
  
Join Date: Sep 2002
Posts: 459
 

Default

Too bad it doesn't work with all browsers... that would be awesome if we could cook one up....
__________________
Joshua Sowin
...taking things one TPL at a time.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 09:30 AM.

   

 
X-Cart forums © 2001-2020