X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Use thumbnail as detailed if detailed image is not available (https://forum.x-cart.com/showthread.php?t=16082)

shan 08-28-2005 04:02 AM

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}


Dorette 08-28-2005 09:36 AM

Oops got this

Fatal error: Smarty error: [in customer/main/product.tpl line 23]: syntax error: mismatched tag {/if}. expected {/section} (opened line 18). (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}

Dorette 09-12-2005 03:15 PM

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

Dorette 11-29-2005 11:22 AM

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


All times are GMT -8. The time now is 01:17 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.