user9903
user9903

Reputation:

How do I remove the “My Cart” and “Checkout” menu links in Magento?

I'm using Magento 1.4 and I want to remove the "Checkout" and "My Cart" links from the top navigation menu. I know I have to change something in a layout file but I'm not sure which one. I searched for "checkout" and "addLink" but found nothing related to those two links.

Upvotes: 4

Views: 12296

Answers (3)

Simon
Simon

Reputation: 661

In order to do BOTH the Checkout link and the Top Cart you'll need to put these within the <default> </default> of your local.xml in your layout folder (app/design/frontend/THEME/THEMENAME/layout/)

// Checkout Link
<reference name="topLinks">
   <remove name="checkout_cart_link" />
</reference>

// Top Cart Link
<reference name="header">
    <action method="unsetChild"><alias>topCart</alias></action>
</reference>

Upvotes: 0

zokibtmkd
zokibtmkd

Reputation: 2183

The best way is to not touch the core layout files, instead your best bet is to create custom theme with only one layout file local.xml like described here To remove the links from the top menu you would need to add these lines in your local.xml file:

<default>
    <reference name="top.links">
        <remove name="checkout_cart_link" />
    </reference>
</default>

I believe this will remove the checkout and my cart links from the top menu. If this doesn't work, try changing top.links with topLinks since in page.xml it is declared as="topLinks"

    <reference name="topLinks">
        <remove name="checkout_cart_link" />
    </reference>

Upvotes: 16

user9903
user9903

Reputation:

To change this in a custom package/theme, copy the layout file checkout.xml from $MAGENTO/app/design/frontend/base/default/layout/checkout.xml to $MAGENTO/app/design/$PACKAGE/$THEME/layout/checkout.xml

Then find the following lines:

  • <action method="addCartLink"></action>
  • <action method="addCheckoutLink"></action>

in that file.

Then just comment those lines out (put <!-- at the beginning of each line and put --> at the end of each line).

In terms of CSS selectors, this would be: layout > default > referance[name='top.links'] > block > action

Upvotes: 5

Related Questions