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

Use thumbnail as detailed if detailed image is not available

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #11  
Old 08-28-2005, 04:02 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

try this.

this checks for a detailed image and if it finds one shows the first . if it dont it shows the thumbnail instead.

Code:
{if $images} {**** START - SHOW FIRST DETAILED ***} {section name=detailed loop=$images} {if $images[0].tmbn_url} [img]{$images[detailed].tmbn_url}[/img] {else} [img]{$xcart_web_dir}/product_image.php?imageid={$images[0].imageid}[/img] {/if} {/section} {**** END - SHOW DETAILED ***} {else} {**** START - SHOW THUMB ***} {include file="product_thumbnail.tpl" productid=$product.productid image_x=$config.Appearance.thumbnail_width product=$product.product tmbn_url=$product.tmbn_url id="product_thumbnail"} {**** END - SHOW THUMB ***} {/if}
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #12  
Old 08-28-2005, 09:36 AM
 
Dorette Dorette is offline
 

Advanced Member
  
Join Date: Jun 2005
Posts: 71
 

Default

Oops got this

Fatal error: Smarty error: [in customer/main/product.tpl line 23]: syntax error: mismatched tag {/if}. expected {/section} (opened line 1. (Smarty_Compiler.class in /home/httpd/vhosts/xxxxxxxxx/httpdocs/Smarty-2.6.3/Smarty.class.php on line 1082


actually this one was okay but shows the no image available instead of the thumbnail, how do I correct that

{if $images}
{include file="modules/Detailed_Product_Images/product_images.tpl" }
{else}
{include file="product_thumbnail.tpl" productid=$products[product].productid image_x=$config.Appearance.thumbnail_width product=$products[product].product tmbn_url=$products[product].tmbn_url}
{/if}
__________________
Version 4.0.17
Reply With Quote
  #13  
Old 09-12-2005, 03:15 PM
 
Dorette Dorette is offline
 

Advanced Member
  
Join Date: Jun 2005
Posts: 71
 

Default

Any help please,
I have the no image available image showing, where there is no detailed image, what I want to show if there is no detailed image is the thumbnail
__________________
Version 4.0.17
Reply With Quote
  #14  
Old 11-29-2005, 11:22 AM
 
Dorette Dorette is offline
 

Advanced Member
  
Join Date: Jun 2005
Posts: 71
 

Default

I tried this

{if $active_modules.Detailed_Product_Images ne ""}
{include file="modules/Detailed_Product_Images/product_images.tpl" }
{else}
{include file="product_thumbnail.tpl" productid=$product.productid image_x=$product.image_x image_y=$product.image_y product=$product.product tmbn_url=$product.tmbn_url id="product_thumbnail"}
{/if}


but it is not showing any thumbnail if no detail is available

I need it to show

if detailed image is available
show detailed image
else thumbnail
end if
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 12:21 PM.

   

 
X-Cart forums © 2001-2020