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

If statement help - wholesale

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 05-06-2007, 10:49 AM
  abeight's Avatar 
abeight abeight is offline
 

X-Adept
  
Join Date: Nov 2003
Location: Cleveland, OH
Posts: 479
 

Default If statement help - wholesale

I have certain design elements that I want to display only to wholesale members. What would this IF statement look like? v 4.0.19

Thank you!
__________________
~ Andrea Beight
Reply With Quote
  #2  
Old 05-06-2007, 11:32 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default Re: If statement help - wholesale

Try:

{if $userinfo.membershipid eq "X"}Show It{/if}
Reply With Quote
  #3  
Old 05-07-2007, 05:05 PM
  abeight's Avatar 
abeight abeight is offline
 

X-Adept
  
Join Date: Nov 2003
Location: Cleveland, OH
Posts: 479
 

Default Re: If statement help - wholesale

Thanks, Jon! That worked.
__________________
~ Andrea Beight
Reply With Quote
  #4  
Old 05-08-2007, 08:15 AM
  abeight's Avatar 
abeight abeight is offline
 

X-Adept
  
Join Date: Nov 2003
Location: Cleveland, OH
Posts: 479
 

Default Re: If statement help - wholesale

Actually upon further review, it looks like the elements are now being hidden from everyone, even the wholesale members.

{if $userinfo.membershipid eq "Wholesale"}
__________________
~ Andrea Beight
Reply With Quote
  #5  
Old 05-08-2007, 08:40 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default Re: If statement help - wholesale

When you add the wholesale membership, it is given a numeric id. You need to use that ID, instead of the word "Wholesale."

If you login as a wholesaler, and put this in your template, it should tell you the ID:

Code:
ID: {$userinfo.membershipid}
Reply With Quote
  #6  
Old 05-08-2007, 08:45 AM
  abeight's Avatar 
abeight abeight is offline
 

X-Adept
  
Join Date: Nov 2003
Location: Cleveland, OH
Posts: 479
 

Default Re: If statement help - wholesale

Hi Jon,

I put that in home.tpl, but it doesn't output a number. Just "ID:"

I looked in the config table in the database and it looks like the numeric ID for Wholesale members is 9, but that didn't work either. *scratching head*
__________________
~ Andrea Beight
Reply With Quote
  #7  
Old 05-08-2007, 08:49 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default Re: If statement help - wholesale

What happens if you output {$userinfo}.

Does it say "Array" on the screen?
Reply With Quote
  #8  
Old 05-08-2007, 08:52 AM
  abeight's Avatar 
abeight abeight is offline
 

X-Adept
  
Join Date: Nov 2003
Location: Cleveland, OH
Posts: 479
 

Default Re: If statement help - wholesale

Nothing - blank.
__________________
~ Andrea Beight
Reply With Quote
  #9  
Old 05-08-2007, 09:01 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default Re: If statement help - wholesale

Sorry, I customized the store I took the code from so much that it's hard to remember what's stock sometimes

Open auth.php and put this code before ?>

Code:
$userinfo = func_query_first("SELECT login,firstname,lastname,membershipid FROM $sql_tbl['customers'] WHERE login='$login'"); $smarty->assign("userinfo", $userinfo);

Reply With Quote
  #10  
Old 05-08-2007, 09:05 AM
  abeight's Avatar 
abeight abeight is offline
 

X-Adept
  
Join Date: Nov 2003
Location: Cleveland, OH
Posts: 479
 

Default Re: If statement help - wholesale

That made the whole site blank.
__________________
~ Andrea Beight
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 04:43 AM.

   

 
X-Cart forums © 2001-2020