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

if command - help!

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 05-09-2004, 06:20 AM
 
kumar kumar is offline
 

Advanced Member
  
Join Date: Apr 2003
Posts: 38
 

Default if command - help!

If I have "ABCD" in param05, is there a way to display the following on the product page:


{if $product.param05 eq "A"}Color: Black{/if}
{if $product.param05 eq "B"}Color: White{/if}
{if $product.param05 eq "C"}Size: Big{/if}
{if $product.param05 eq "D"}Size: Small{/if}

etc...

I tried the above, but it only recognizes the first character in the param05 field, and displays the data only for that.

For example, if param05 has "AC", it should display "Color: Black Size: Big", but only displays "Color: Black" because "A" is the first character in param05.

I think it has to do with the "eq" command.

Please help!
Reply With Quote
  #2  
Old 05-09-2004, 06:21 AM
 
kumar kumar is offline
 

Advanced Member
  
Join Date: Apr 2003
Posts: 38
 

Default

Is there a way to use a "like" command instead of "eq"?
Reply With Quote
  #3  
Old 05-09-2004, 03:25 PM
 
mikebo mikebo is offline
 

Advanced Member
  
Join Date: Feb 2004
Location: Ohio
Posts: 72
 

Default

Hi Kumar

I have this page bookmarked in my browser because I use it frequently. Hope it helps you.

http://smarty.php.net/manual/en/language.function.if.php


Mike
__________________
Mike
X-Cart Gold
Version 4.6.0 PHP 5.2.17
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 09:48 AM.

   

 
X-Cart forums © 2001-2020