X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Hiding a membership level (https://forum.x-cart.com/showthread.php?t=67883)

nhicks 10-04-2013 02:00 PM

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

cherie 10-04-2013 05:36 PM

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} 


nhicks 10-05-2013 06:05 PM

Re: Hiding a membership level
 
YES, perfect. As I suspected, so simple. Thanks, Cherie!

Nicole


All times are GMT -8. The time now is 10:31 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.