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

Hiding a membership level

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 10-04-2013, 02:00 PM
 
nhicks nhicks is offline
 

Newbie
  
Join Date: Mar 2012
Posts: 4
 

Default Hiding a membership level

Heya everyone.

I have three different membership levels and I want to hide one from the register.php page. I don't want to disable membership sign-ups, because I want my customers to be able to sign up on the other two levels without needing to be approved in the back end. All of the searching on this topic I've done has ended with that being the answer, but it's not for me. I need this one level hidden from the public so only admin can create a user profile for that level.

Right now, I have this code set up on membership_signup.tpl:

Code:
{foreach from=$membership_levels item=v} <option value="{$v.membershipid}"{if $userinfo.pending_membershipid eq $v.membershipid} selected="selected"{/if}>{$v.membership}</option> {/foreach}

Pretty standard, I'm guessing. My membership IDs are 5, 6, and 7, with 7 being the level I don't want displayed, and I've tried several if/then statements and their variations to try getting it to break before it reaches that level:

Code:
{if $v.membershipid.index == 6} {break} {/if} {if $membership_levels.membershipid == 6} {break} {/if}

Since I only have three active membership levels right now, I also tried:

Code:
{if $membership_levels == 2} {break} {/if}

I've tried putting these statements directly after the foreach and inside the option tags, but nothing works. I have this depressing thought that it could be a super easy solution that I'm just not seeing, so please, any ideas?

Thanks,
Nicole
__________________
---

X-Cart Gold, 4.4.3
Reply With Quote
  #2  
Old 10-04-2013, 05:36 PM
  cherie's Avatar 
cherie cherie is offline
 

X-Wizard
  
Join Date: May 2003
Location: USA
Posts: 1,534
 

Default Re: Hiding a membership level

Smarty "break" isn't around until v3 so that won't work. Try this (added if condition):
PHP Code:
...
      {foreach 
from=$membership_levels item=v}

{if 
$v.membershipid ne 7}

        <
option value="{$v.membershipid}"{if $userinfo.pending_membershipid eq $v.membershipidselected="selected"{/if}>{$v.membership}</option>

{/if}

      {/foreach} 
__________________
redlimeweb.com
custom mods and design integration
4.7 linux
Reply With Quote
  #3  
Old 10-05-2013, 06:05 PM
 
nhicks nhicks is offline
 

Newbie
  
Join Date: Mar 2012
Posts: 4
 

Default Re: Hiding a membership level

YES, perfect. As I suspected, so simple. Thanks, Cherie!

Nicole
__________________
---

X-Cart Gold, 4.4.3
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 07:17 AM.

   

 
X-Cart forums © 2001-2020