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 Menu/Category Based on Membership Level (https://forum.x-cart.com/showthread.php?t=38974)

rkdiddy 04-10-2008 04:46 PM

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

Holub 04-11-2008 04:13 AM

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.

rkdiddy 04-11-2008 07:38 AM

Re: Hiding a Menu/Category Based on Membership Level
 
Perfect - thanks!

rkdiddy 04-11-2008 01:26 PM

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?

John Livesey 05-07-2008 04:04 AM

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

Holub 05-07-2008 04:14 AM

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.

John Livesey 05-14-2008 04:09 AM

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

Holub 05-14-2008 04:42 AM

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}


John Livesey 05-14-2008 04:53 AM

Re: Hiding a Menu/Category Based on Membership Level
 
Thank you so much - it works perfectly now :D

Holub 05-14-2008 05:05 AM

Re: Hiding a Menu/Category Based on Membership Level
 
I'm glad that I've help you!


All times are GMT -8. The time now is 04:35 PM.

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