1

I need to show the different options according to group of the customer in MY ACCOUNT section.

For example, I need to show only My profile, Account Information, social media accounts link in the MY ACCOUNT section of the customer dashboard. Some of links will be custom controller actions so how I can show these link and manage the session so that all this happened only when the customer is login.

1

Step 1: Go To ( YourTemplate/customer/account/navigation.phtml )

Step 2: Replace This Line: <?php $_count = count($_links); ?>

<?php $_count = count($_links); /* Add or Remove Account Left Navigation Links Here -*/
    unset($_links['account']); /* Account Info */     
    unset($_links['account_edit']); /* Account Info */            
    unset($_links['tags']); /* My Tags */
    unset($_links['invitations']); /* My Invitations */
    unset($_links['reviews']);  /* Reviews */
    unset($_links['wishlist']); /* Wishlist */
    unset($_links['newsletter']); /* Newsletter */
    unset($_links['orders']); /* My Orders */
    unset($_links['address_book']); /* Address */
    unset($_links['enterprise_customerbalance']); /* Store Credit */
    unset($_links['OAuth Customer Tokens']); /* My Applications */
    unset($_links['enterprise_reward']); /* Reward Points */
    unset($_links['giftregistry']); /* Gift Registry */
    unset($_links['downloadable_products']); /* My Downloadable Products */
    unset($_links['recurring_profiles']); /* Recurring Profiles */
    unset($_links['billing_agreements']); /* Billing Agreements */
    unset($_links['enterprise_giftcardaccount']); /* Gift Card Link */
?> 

if you want to do this in module then override

<customer_account>
   <reference name="customer_account_navigation">
      <action method="setTemplate"><template>modulename/customer/account/navigation.phtml</template></action>
    </reference>
</customer_account>

for checking the session

checing the session of user

if(!Mage::getSingleton('customer/session')->isLoggedIn()){
             $this->setFlag('', 'no-dispatch', true);

        $this->_redirect('customer/account');
        return ;
    }

getting the customer group

$customerData = Mage::getSingleton('customer/session')->getCustomer();
$customerData->getGroupId()
  • Thanks for the answer. Let me do this way. will get back to you. Thanks again. – mudit mehrotra Aug 30 '16 at 12:27
  • for Step 1 you mean this path: app/design/frontend/base/default/template/customer/account/navigation.phtml – mudit mehrotra Aug 30 '16 at 13:31
  • @muditmehrotra yes – Qaisar Satti Aug 30 '16 at 14:10
  • Now I know how to show/hide the navigation link according to the group but how to add a custom controller action as a link and open its content in the dashboard. For example, Controller action->Profile View->template/modulename/profile.phtml Now I need to add the profile as link in the navigation and show the profile.phtml contents inside the dashboard. – mudit mehrotra Aug 31 '16 at 7:25
  • for that you have rewrite the customer controller. – Qaisar Satti Aug 31 '16 at 7:30

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.