Evaluating custom member fields
Posted: 23 July 2008 08:09 PM   [ Ignore ]
Jr. Member
RankRank
Total Posts:  45
Joined  2006-07-16

Hey Solspace people.

What I need to do is not so much display user info but evaluate it. Can User help me?

Here’s an example: while on a regular page, what I want to do is evaluate values in custom member fields, and then display different information based on that.

So, if a logged in user has a “ship_country” value of Canada or the USA, I’d like it to say (in so many words):

“Thanks! No extra charges for shipping within Canada or the USA.”

But if “ship_country“‘s value is not Canada nor the USA, I’d like it to say

“There are shipping charges.”

Presently, I can’t get expresson engine’s “member custom fields” function to evalute like that, and I also can’t seem to get va_custom_member able to do that either. So I was wondering if User could help.

Profile
 
 
Posted: 24 July 2008 05:51 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3356
Joined  2006-10-18

This should be doable:

{if ship_country == "Canada" ||  ship_country == "USA"}
<p>Thanks! No extra charges for shipping within Canada or the USA!</p>
{if:else}
<p>There are shipping charges.</p>
{/if}

Or

{if ship_country == "Canada"}
<p>Thanks! No extra charges for shipping within Canada!</p>
{if:elseif ship_country == "USA"}
<p>Thanks! No extra charges for shipping within the USA!</p>
{if:else}
<p>There are shipping charges.</p>
{/if}

This would of course have to be wrapped with the User:Stats loop smile

 Signature 
Profile