[ic] if statement

Miguel Navarro interchange-users@icdevgroup.org
Thu Feb 20 11:10:01 2003


> > I have looked through the docs and am comming short on one part.
> > Basically I want to modify a region based on the category for a product
> > I got this far
> > [if-item-field category =~ /Business Bundles/]
> > <tr><td><b>Business Bundle</b></td></tr>
> > [/if-item-field]
> > [item-field category]
> > I put in the last line to check and see if the value was wrong. What I
get
> > is
> > Business Bundle
> > Which is the last line so I know that the category is comming through
> fine.
> > What am I doing wrong??
> > Thanks
>>
> > I have also tried as [if [item-field] eq "Business Bundle"] and [if
value
> > item-field eq "Business Bundle"]
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> > What about
> >
> > [if value category eq~ /Business Bundles/]
> > <tr><td><b>Business Bundle</b></td></tr>
> > [else]
> > [item-field category]
> > [/else]
> > [/if]
> >
> >
>
> I have tried that as well, with no result... the [item-field category] tag
> is outside the if statement so that I can see that the value is in fact
> "Business Bundle" and therefore should work in the if statement. But I
must
> be writing the if statement incorrectly..
>
I figured out a workaround... Here is what I did

[set dcategory][item-field category[/set]

now in the if statement

[if scratch dcategory eq "Business Bundles"]
<tr><td>WOrks</td></tr>
[/if]
[item-field category]

Don't know why I had to set the value first instead of directly setting the
conditional statement. But if anyone else had an issue that is how I fixed
it.

M