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)
-   -   Detailed Images greater than 1 conditional (https://forum.x-cart.com/showthread.php?t=24292)

Skygazer 08-22-2006 11:21 AM

Detailed Images greater than 1 conditional
 
Here's my question, I want to code a conditional that does the following action; if detailed images exist and is greater than 1 image show 'this' else show 'something else'. Can anyone help me with this language?

{section name=image loop=$images}
{if $images[image] > ?? }
this
{else}
something else
{/if}
{/section}

Thanks
Marc

wjbrewer 08-24-2006 11:28 PM

Re: Detailed Images greater than 1 conditional
 
This should work...however, I didn't test it, and it is late here.

add to modules/Detailed_Product_Images/product_images.php

PHP Code:

$image_check func_query_first_cell("SELECT count(imageid) FROM xcart_images WHERE productid='$productid'");
$smarty->assign('image_check'$image_check); 


Then add to your image template
Code:

{if $image_check >= "2"}
Code to show if there is more than one detailed image
{else}
Code to show if there is one detailed image.
{/if}


Skygazer 09-03-2006 01:13 PM

Re: Detailed Images greater than 1 conditional
 
Thanks I'll give it a try and let you know how it works.

pig@pp 09-05-2008 09:58 AM

Re: Detailed Images greater than 1 conditional
 
The following worked for us in v4.1.9

add to modules/Detailed_Product_Images/product_images.php

#
# Count Detail Images
#
$image_check = func_query_first_cell("SELECT count(imageid) FROM xcart_images_D WHERE id='$productid'");
$smarty->assign('image_check', $image_check);


Usage:

{if $image_check >= "X"}
something to show here
{else}
something else to show here
{/if}


All times are GMT -8. The time now is 06:04 AM.

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