0

i have to remove "My account" & "Log out" links from some phtml pages. for removing my account, i am using following code :

<marketplace_marketplaceaccount_myproductslist>
<reference name="top.links">
   <remove name="account_link"/>
</reference>
</marketplace_marketplaceaccount_myproductslist>

for removing Login and log out , i am using following code :

<marketplace_marketplaceaccount_myproductslist>
<action method="removeLinkByUrl">
<url helper="customer/getLoginUrl"/>
</action>
</marketplace_marketplaceaccount_myproductslist>

but both are not working

Update :header.phtml

<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category    design
 * @package     base_default
 * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
/**
 * @var Mage_Page_Block_Html_Header $this
 */
?>
<div class="Manoj">
<div class="Ma">
    <div id="top_head">
      <div class="header_top">
              <div class="header_top_link">               
                <?php echo $this->getChildHtml('store_switcher_header') ?>
                <?php echo $this->getChildHtml('currency') ?>
                <?php echo $this->getChildHtml('store_language') ?>
                <?php echo $this->getChildHtml('topLinks') ?>  
              </div>
            </div>
            <p class="welcome-msg"><?php echo $this->getChildHtml('welcome') ?> <?php echo $this->getAdditionalHtml() ?></p>

    </div>
<div id="main_header">
<div class="header-container">
    <div class="header">
    <!--<div class="grid_7 alpha">-->
    <div class="logo">
      <div class="Header_logo">
        <?php if ($this->getIsHomePage()):?>
        <h1 class="logo"><strong><?php echo $this->getLogoAlt() ?></strong><a href="<?php echo $this->getUrl('') ?>" title="<?php echo $this->getLogoAlt() ?>" class="logo"><img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" /></a></h1>
        <?php else:?>
        <h1 class="logo"><a href="<?php echo $this->getUrl('') ?>" title="<?php echo $this->getLogoAlt() ?>" class="logo"><strong><?php echo $this->getLogoAlt() ?></strong><img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" /></a></h1>
        <?php endif?>
      </div>

    <!--</div>-->
    <!--<div class="grid_17 omega">-->

      <div class="header_search">
      <?php echo $this->getChildHtml('topSearch') ?>
      </div>

      <div class="div_link-cart">
                <?php echo $this->getChildHtml('cart_sidebar');?>
            </div>

    <!--</div>-->
    </div>
    <div class="clear"></div>

        <?php echo $this->getChildHtml('topContainer'); ?>
    </div>
</div>
<div class="container_menu">
  <div class="inner_menu">
    <?php echo $this->getChildHtml('topMenu') ?>
  </div>
</div>
</div>
</div>
</div>

<p id="back-top"><a href="#top" title="<?php echo $this->__('Back to Top') ?>"><?php echo $this->__('Back to Top') ?></a></p>

<style>

ul.solidblockmenu li a {
  border-right: 2px solid #333;
  color: #fff;
  display: block;
  float: left;
  font-size: 14px;
  height: 51px;
  line-height: 38px;
  padding: 0 25px;
  text-align: center;
  text-decoration: none;
  width: 198px !important;
}
</style>

local.xml

<?xml version="1.0" encoding="UTF-8"?>
<layout>
    <default>
        <action method="unsetChild"><name>catalog.compare.sidebar</name></action>
    </default>


    <checkout_cart_index> 
        <reference name="header"> 
            <block type="page/header" name="header">
                <action method="setTemplate"><template>checkout/cart/cart_header.phtml</template></action> 
            </block>
        </reference>
    </checkout_cart_index> 



    <checkout_onepage_index> 
        <reference name="header"> 
            <block type="page/header" name="header">
                <action method="setTemplate"><template>checkout/cart/checkout_header.phtml</template></action> 
            </block>
        </reference>
    </checkout_onepage_index> 



    <marketplace_marketplaceaccount_myproductslist> 
    <action method="removeLinkByUrl"><url helper="customer/getAccountUrl"/></action>
    <action method="removeLinkByUrl"><url helper="customer/getLogoutUrl"/></action>

    </marketplace_marketplaceaccount_myproductslist>

</layout>
  • 1
    try this <reference name="top.links"> <action method="removeLinkByUrl"><url helper="customer/getLoginUrl"/></action> </reference> – Magento 2 Nov 17 '15 at 7:32
  • Logout <reference name="top.links"> <action method="removeLinkByUrl"><url helper="customer/getLogoutUrl"/></action> </reference> – Magento 2 Nov 17 '15 at 7:35
  • its not working...... – Baby in Magento Nov 17 '15 at 7:36
  • <marketplace_marketplaceaccount_myproductslist> <action method="removeLinkByUrl"> <url helper="customer/getAccountUrl"/> </action> </marketplace_marketplaceaccount_myproductslist> use that – Qaisar Satti Nov 17 '15 at 7:43
  • <marketplace_marketplaceaccount_myproductslist> <reference name="top.links"> <action method="removeLinkByUrl"><url helper="customer/getLoginUrl"/></action> </reference></marketplace_marketplaceaccount_myproductslist> use this way – Magento 2 Nov 17 '15 at 7:46
1

use this to remove account and logout

    <marketplace_marketplaceaccount_myproductslist> 
    <reference name="top.links"> 
    <action method="removeLinkByUrl"><url helper="customer/getLogoutUrl"/></action>
    <action method="removeLinkByUrl"><url helper="customer/getAccountUrl"/></action>
     </reference>
 </marketplace_marketplaceaccount_myproductslist>
|improve this answer|||||
  • no, still log out is there..... – Baby in Magento Nov 17 '15 at 8:04
  • Did you remove from top link or some other place – Qaisar Satti Nov 17 '15 at 8:06
  • before i used css to remove top links, now i removed that css. i am using xml to remove log out..... – Baby in Magento Nov 17 '15 at 8:08
  • updated xml use it and feedback – Qaisar Satti Nov 17 '15 at 9:23
  • sorry, its not working... – Baby in Magento Nov 17 '15 at 9:37
1

To remove Myaccount, Register, Logout url from top links

e.g, to remove the links in home page

<cms_index_index>
        <reference name="top.links">
            <action method="removeLinkByUrl"><url helper="customer/getAccountUrl" /></action>  <!-- My account -->
            <action method="removeLinkByUrl"><url helper="customer/getLogoutUrl" /></action>   <!-- Log out -->
            <action method="removeLinkByUrl"><url helper="customer/getRegisterUrl" /></action>  <!-- Register -->
        </reference>
</cms_index_index>

Note : Make sure you layout file loaded correctly and make sure your handle is correct.

|improve this answer|||||
  • my account is removing, please help me for log out..... – Baby in Magento Nov 17 '15 at 7:54
  • 1
    did you add logout through XML or directly added in phtml file? – MeenakshiSundaram R Nov 17 '15 at 7:57
  • i added your code in local.xml file – Baby in Magento Nov 17 '15 at 7:59
  • i guess "Logout" url is directly hard coded in phtml file – MeenakshiSundaram R Nov 17 '15 at 8:01
  • please let me know what file code you want to check, so that i can post here..... – Baby in Magento Nov 17 '15 at 8:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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