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

Detailed Images greater than 1 conditional

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 08-22-2006, 11:21 AM
 
Skygazer Skygazer is offline
 

Newbie
  
Join Date: Aug 2006
Posts: 5
 

Default 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
__________________
Marc Boucher
X-Cart Gold V4.0.18 (Mac OS X Server)
Reply With Quote
  #2  
Old 08-24-2006, 11:28 PM
  wjbrewer's Avatar 
wjbrewer wjbrewer is offline
Banned
 

X-Adept
  
Join Date: Feb 2005
Location: Pittsburgh, PA
Posts: 504
 

Default 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}
Reply With Quote
  #3  
Old 09-03-2006, 01:13 PM
 
Skygazer Skygazer is offline
 

Newbie
  
Join Date: Aug 2006
Posts: 5
 

Default Re: Detailed Images greater than 1 conditional

Thanks I'll give it a try and let you know how it works.
__________________
Marc Boucher
X-Cart Gold V4.0.18 (Mac OS X Server)
Reply With Quote
  #4  
Old 09-05-2008, 09:58 AM
  pig@pp's Avatar 
pig@pp pig@pp is offline
 

Advanced Member
  
Join Date: Mar 2006
Location: San Luis Obispo, CA
Posts: 38
 

Default 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}
__________________
http://www.polyperformance.com/
4.1.9 Gold (x7)
Hosting by EWDHosting.com
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 06:09 AM.

   

 
X-Cart forums © 2001-2020