Store Community Support Documentation

Hi everyone,

Does anyone know how to remove 'Memberships' from the user menu? I use meberships to determine usergroups duirng the registration and all subscriptions packages are free so they don't have a purpose once someones creates an account. 

Thanks a lot! 

Be the first person to like this.
JohnJr
#1

Hello Aleksandar,

First, only do this if you feel very comfortable with messing with code.  Also, any updates or even rebuild core may erase this hack.  Always make two extra copies of the file.  In this case, I would name them

block.template-notification.html.php (this is the file being used - which after your done with have the new code added but do not hit save until you make the two additional copies below.)

block.template-notification.html_ORG.php (this is a copy of the original above before changes)

block.template-notification.html_CODE.php (this is a copy of the original with the code so if the original is written over with an update, you are able to look at what you did.  I always write done in an excel sheet what code I added to what file and what line number did it start.  You can't just slap this entire file with a copy and paste because during upgrades there may have been changes to other code located in this file.  But by writing the line you affected like in this case est line 168-175 had change done by me.)

The location of the file is

PF.Site/flavors/your theme/html/core.block.template-notification.html.php

I wrapped that menu with an if statement for the admin can only to see, which is exactly what phpfox code did right below for the menu item called admincp.

            {plugin call='core.template_block_notification_dropdown_menu'}             {if Phpfox::isAdmin() }                 <li role="presentation">                     <a href="{url link='subscribe'}">                         <i class="ico ico-trophy-o"></i>                         {_p var='membership'}                     </a>                 </li>             {/if}             {if Phpfox::isAdmin() }                 <li role="presentation">                     <a href="{url link='admincp'}" target="_blank" class="no_ajax">                         <i class="ico ico-gear-o"></i>                         {_p var='menu_admincp'}                     </a>                 </li>             {/if}

Thank you John so much, I knew I could count on you! :) This is great! And thanks for the detailed instruction! 

JohnJr
#3

Oh yeah...don't forget to clear the cache after any changes :)