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

product.tpl image display!!!!!

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 02-17-2003, 01:42 AM
 
ciava ciava is offline
 

Advanced Member
  
Join Date: Nov 2002
Location: UK
Posts: 56
 

Default product.tpl image display!!!!!

Hi All

Still having trouble with the product tpl. The problem i need resolving is as follows:-

i have a number of featured products which include thumbnail images, when the product is clicked for more details and the product.tpl is displayed i want to have a detailed image displayed, if there is no detailed image i want the thumbnail to display instead and if there is no thumbnail then i have added a new no_image.tpl which includes an graphic stating there isn't a picture of the product. i've tried using the code below to swap the detailed image for my new tpl if there is no detailed image but this won't even work so any help would be great!!


{section name=image loop=$images} {if $images[image].avail eq ""} [img]../product_image.php?imageid={$images[image].imageid}[/img]
{else}{include file="customer/main/noimage.tpl" }{/if} {/section}

regards

jon
Reply With Quote
  #2  
Old 02-20-2003, 10:56 AM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

I did a slight variation on this which shows the first detailed product image instead of the thumbnail.

First I cretaed a new template in modules/detailed_product_images/product_images_main.tpl

Code:
{if $images ne ""} {section name=image loop=$images} {if $images[image].avail eq "Y"} {if $smarty.section.image.index eq 0} [img]../product_image.php?imageid={$images[image].imageid}[/img] {else} {/if} {/if} {/section} {/if}

Then amended the product.tpl template to show the code below where you want the detailed image to show:

Code:
{if $active_modules.Detailed_Product_Images ne ""} {include file="modules/Detailed_Product_Images/product_images_main.tpl" } {else} {include file="product_thumbnail.tpl" productid=$product.productid image_x=$product.image_x image_y=$product.image_y product=$product.product} {/if}

This will show the detail image if there is one, if not then show the thumbnail and if there isn't one of those then the standard no image icon will appear. You will need to load a new personalised one up.
__________________
ex x-cart guru
Reply With Quote
  #3  
Old 02-20-2003, 10:59 AM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

Please note that unless you modify the product images template then the first detail image will show twice. If you dont want this then amend code to the following:
Code:
{if $images ne ""} {section name=num loop=$images} {/section} {if %num.index% <2} {else} {capture name=dialog} <table border=0 width=100% cellpadding=2 cellspacing=0> <tr> {section name=image loop=$images} {if $images[image].avail eq "Y"} {if $smarty.section.image.index eq 0} {else} <td align=center valign=top> [img]../product_image.php?imageid={$images[image].imageid}[/img] </td> {if $smarty.section.image.index is even} </tr> <tr> {/if} {/if} {/if} {/section} </tr> </table> {/capture} {if $smarty.capture.dialog ne ""} {include file="dialog.tpl" title=$lng.lbl_detailed_images content=$smarty.capture.dialog extra="width=100%"} {/if} {/if} {/if}

btw this show two images per row.
__________________
ex x-cart guru
Reply With Quote
  #4  
Old 03-04-2003, 05:48 AM
 
John7 John7 is offline
 

Senior Member
  
Join Date: Jan 2003
Posts: 136
 

Default Question About This Mod

What happens if you have more than one detailed images?

Where do the other images go?
Reply With Quote
  #5  
Old 03-04-2003, 05:54 AM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

They just show up as normal in the detailled images area on the product page.
__________________
ex x-cart guru
Reply With Quote
  #6  
Old 03-04-2003, 06:49 AM
 
John7 John7 is offline
 

Senior Member
  
Join Date: Jan 2003
Posts: 136
 

Default Thanks

Awsome!!!!!!!!!!!
Reply With Quote
  #7  
Old 03-04-2003, 06:55 AM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

A client needed it this way so I built it.

That is the beauty of x-cart...it can do almost anything
__________________
ex x-cart guru
Reply With Quote
  #8  
Old 03-04-2003, 10:15 AM
 
John7 John7 is offline
 

Senior Member
  
Join Date: Jan 2003
Posts: 136
 

Default One more thing

I saw it mentioned that it displays two products per row.

How can we make it display one product per row.

I'm about to implement your mod.

This is cool.

What I have already done is delete the icon dispay code and move the detailed image code in its place, but I think your mod will work much better.

Thanks
Reply With Quote
  #9  
Old 03-04-2003, 10:51 AM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

change it to:

Code:
{if $images ne ""} {section name=num loop=$images} {/section} {if %num.index% <2} {else} {capture name=dialog} <table border=0 width=100% cellpadding=2 cellspacing=0> <tr> {section name=image loop=$images} {if $images[image].avail eq "Y"} {if $smarty.section.image.index eq 0} {else} <td align=center valign=top> [img]../product_image.php?imageid={$images[image].imageid}[/img] </td> {/if} {/if} {/section} </tr> </table> {/capture} {if $smarty.capture.dialog ne ""} {include file="dialog.tpl" title=$lng.lbl_detailed_images content=$smarty.capture.dialog extra="width=100%"} {/if} {/if} {/if}
__________________
ex x-cart guru
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


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 03:24 AM.

   

 
X-Cart forums © 2001-2020