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

Hiding a Menu/Category Based on Membership Level

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 04-10-2008, 04:46 PM
  rkdiddy's Avatar 
rkdiddy rkdiddy is offline
 

Advanced Member
  
Join Date: Mar 2005
Posts: 60
 

Default Hiding a Menu/Category Based on Membership Level

Is there a way of hiding a (custom) menu/category based on membership level? I know this can be done with Categories, but for instance if I wanted to set up a seperate menu that was only viewable if you were a member of "x", how would I do that????


Thanks,

Rick
__________________
Stealth Cords - Discrete Power Cords for Automotive Enthusiasts
www.stealthcords.com
X-Cart version: 4.1.9
Reply With Quote
  #2  
Old 04-11-2008, 04:13 AM
  Holub's Avatar 
Holub Holub is offline
 

X-Adept
  
Join Date: Jan 2008
Posts: 432
 

Default Re: Hiding a Menu/Category Based on Membership Level

As I know you can use such Smarty code (for example):

{if $userinfo.membership eq "Premium"}
...your menu...
{/if}

In the case of Premium membership menu the will displayed.
__________________
Regards,
Anthony Holub

X-Cart Skins Store
- twenty two different skins available;
- both 4.1.x and 4.2.x versions compatible;
- refresh you store now!

Smart menu X-Cart add-on
Featured Products Slide Show X-Cart add-on
"What's New?" FREE X-Cart add-on
Reply With Quote
  #3  
Old 04-11-2008, 07:38 AM
  rkdiddy's Avatar 
rkdiddy rkdiddy is offline
 

Advanced Member
  
Join Date: Mar 2005
Posts: 60
 

Default Re: Hiding a Menu/Category Based on Membership Level

Perfect - thanks!
__________________
Stealth Cords - Discrete Power Cords for Automotive Enthusiasts
www.stealthcords.com
X-Cart version: 4.1.9
Reply With Quote
  #4  
Old 04-11-2008, 01:26 PM
  rkdiddy's Avatar 
rkdiddy rkdiddy is offline
 

Advanced Member
  
Join Date: Mar 2005
Posts: 60
 

Default Re: Hiding a Menu/Category Based on Membership Level

Quote:
{if $categories ne "" and ($active_modules.Fancy_Categories ne "" or $config.General.root_categories eq "Y" or $subcategories ne "")}
{include file="customer/categories.tpl" }
<br />

{/if}

{if $userinfo.membership eq "Field Marketing Managers"}
{include file="customer/categories3.tpl" }
{/if}


For some reason it doesn't seem to be working for me on the homepage. If I log on it still won't show the menu - however if I hit view cart the menu will pop-up.

Any ideas?
__________________
Stealth Cords - Discrete Power Cords for Automotive Enthusiasts
www.stealthcords.com
X-Cart version: 4.1.9
Reply With Quote
  #5  
Old 05-07-2008, 04:04 AM
 
John Livesey John Livesey is offline
 

Advanced Member
  
Join Date: May 2008
Posts: 33
 

Default Re: Hiding a Menu/Category Based on Membership Level

This doesn't appear to work for me. I have put

Quote:
{if $userinfo.membership eq "Registered"}
{include file="customer/downloadbox.tpl"}
{/if}
<br />

In my customer/main.tpl and have a custom menu box called downloadbox.tpl

The box won't display when I log in to the site.

Any ideas please?

Thanks
__________________
Version: 4.1.9
Reply With Quote
  #6  
Old 05-07-2008, 04:14 AM
  Holub's Avatar 
Holub Holub is offline
 

X-Adept
  
Join Date: Jan 2008
Posts: 432
 

Default Re: Hiding a Menu/Category Based on Membership Level

Please, try to insert into /customer/home.tpl the row like

!{$userinfo.membership}! and !{$userinfo.membershipid}!

and log in. If you will see anything between two "!" please inform. Seems like membership variable is empty but membershipid must be filled with 0 or more than 0.
__________________
Regards,
Anthony Holub

X-Cart Skins Store
- twenty two different skins available;
- both 4.1.x and 4.2.x versions compatible;
- refresh you store now!

Smart menu X-Cart add-on
Featured Products Slide Show X-Cart add-on
"What's New?" FREE X-Cart add-on
Reply With Quote
  #7  
Old 05-14-2008, 04:09 AM
 
John Livesey John Livesey is offline
 

Advanced Member
  
Join Date: May 2008
Posts: 33
 

Default Re: Hiding a Menu/Category Based on Membership Level

Hi

I get nothing between either sets of !! so it would indicate that the variables are blank for some reason.

Thanks for any advice given

John
__________________
Version: 4.1.9
Reply With Quote
  #8  
Old 05-14-2008, 04:42 AM
  Holub's Avatar 
Holub Holub is offline
 

X-Adept
  
Join Date: Jan 2008
Posts: 432
 

Default Re: Hiding a Menu/Category Based on Membership Level

Okey.
Insert into the end of auth.php before "?>"
Code:
if ($login) $smarty->assign("cur_membership", func_query_first_cell("select membershipid from $sql_tbl[customers] where login = '$login'"));
This code allows use customer's membershipid if he logged in.
In /skin1/customer/home.tpl insert
Code:
{if $cur_membership eq 2} {include file="customer/categories3.tpl" } {/if}
Of course, in condition '$cur_membership eq 2' you should use membership ID (customers who can view menu) instead of "2".
You can find out membershipid via code in /skin1/customer/home.tpl
Code:
{$cur_membership} <---- this tag allows you to find out id. {if $cur_membership eq 2} <---- insert id instead of 2 {include file="customer/categories3.tpl" } {/if}
__________________
Regards,
Anthony Holub

X-Cart Skins Store
- twenty two different skins available;
- both 4.1.x and 4.2.x versions compatible;
- refresh you store now!

Smart menu X-Cart add-on
Featured Products Slide Show X-Cart add-on
"What's New?" FREE X-Cart add-on
Reply With Quote
  #9  
Old 05-14-2008, 04:53 AM
 
John Livesey John Livesey is offline
 

Advanced Member
  
Join Date: May 2008
Posts: 33
 

Default Re: Hiding a Menu/Category Based on Membership Level

Thank you so much - it works perfectly now
__________________
Version: 4.1.9
Reply With Quote
  #10  
Old 05-14-2008, 05:05 AM
  Holub's Avatar 
Holub Holub is offline
 

X-Adept
  
Join Date: Jan 2008
Posts: 432
 

Default Re: Hiding a Menu/Category Based on Membership Level

I'm glad that I've help you!
__________________
Regards,
Anthony Holub

X-Cart Skins Store
- twenty two different skins available;
- both 4.1.x and 4.2.x versions compatible;
- refresh you store now!

Smart menu X-Cart add-on
Featured Products Slide Show X-Cart add-on
"What's New?" FREE X-Cart add-on
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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:47 AM.

   

 
X-Cart forums © 2001-2020