View Single Post
  #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