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
  #11  
Old 05-08-2007, 09:13 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, like I said, probably too many customizations

Put this in your auth.php:

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

Then output to your template:

ID: {$userinfo.membership}

Let me know what is output.
Reply With Quote
  #12  
Old 05-08-2007, 09:20 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

No problem, I really appreciate your help, Jon.

Unfortunately, that made the front-end of the site blank again.
__________________
~ Andrea Beight
Reply With Quote
  #13  
Old 05-08-2007, 09: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

Are you able to provide FTP to the site? It would be easier to see the exact files and be able to debug without causing problems to the customers
Reply With Quote
  #14  
Old 05-08-2007, 09:46 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

Absolutely, I'll send you a PM.
__________________
~ Andrea Beight
Reply With Quote
  #15  
Old 05-08-2007, 10:09 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

Here's the code to us:

In auth.php before ?>

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

Code in your templates:

Code:
{if $userinfo.membership eq "Wholesale"} Show Text{/if}
Reply With Quote
  #16  
Old 05-08-2007, 10:23 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

Yay, it worked! Thank you so much, Jon!!!!
__________________
~ Andrea Beight
Reply With Quote
  #17  
Old 05-22-2007, 12:33 PM
 
joshmoran12020 joshmoran12020 is offline
 

Member
  
Join Date: May 2007
Posts: 13
 

Default Re: If statement help - wholesale

Which template file has the homes main content information. I want a link to be displayed on the main home page as long as the user has a Premium membership
__________________
x-cart-4.1.7gold
Josh
Reply With Quote
  #18  
Old 05-22-2007, 12:47 PM
  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

skin1/customer/main/welcome.tpl
Reply With Quote
  #19  
Old 05-22-2007, 01:00 PM
 
joshmoran12020 joshmoran12020 is offline
 

Member
  
Join Date: May 2007
Posts: 13
 

Default Re: If statement help - wholesale

I get an error when putting that code in my auth.php
__________________
x-cart-4.1.7gold
Josh
Reply With Quote
  #20  
Old 05-22-2007, 01:09 PM
  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

The code for 4.1.7 would be different, I believe:

Code for auth.php before ?>

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

Code for use in template:

Code:
{* Where "X" is the numeric membershipid *} {if $userinfo.membershipid eq "X"} Show Text{/if}
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 11:59 AM.

   

 
X-Cart forums © 2001-2020