How to edit the top menu links in ZenCart

By default, ZenCart displays a link to your store home page and login page. This tutorial will show you how to edit, delete and/or add links to this menu.

edittoplinks1

To edit these links, you will need to open the tpl_header.php file. If you are using the default ZenCart template, this file will be located here:

YOUR_PATH_TO_ZENCART/includes/templates/template_default/common/

Using either Notepad or WordPad, open the tpl_header.php file.

Locate the following code, starting with < ! –bof-navigation display — >

edittoplinks2

To ADD a new link, find the following code:

< li >< ?php echo ‘< a href=”‘ . HTTP_SERVER . DIR_WS_CATALOG . ‘”>’; ?>< ?php echo HEADER_TITLE_CATALOG; ?>< /a >< /li >

Code to add after above line:

< li >< a href=”YOUR LINK HERE”>YOUR LINK TEXT HERE< /a >< /li >

NOTE: This will add your custom link AFTER the “Home” link as shown below. You can place your link before/after any of the other links in this section.

edittoplinks3

To DELETE a link, simply remove the entire line referencing the link starting with < li > and ending with < /li >

To EDIT a link, simply replace the current link or text with your own.

For example, let’s say you want the “Home” link to go to your main index page instead of the main store page. The current link is shown as:

< li >< ?php echo ‘< a href=”‘ . HTTP_SERVER . DIR_WS_CATALOG . ‘”>’; ?>< ?php echo HEADER_TITLE_CATALOG; ?>< /a >< /li >

You would want to change this to:

< li >< ?php echo ‘< a href=”http://YOURDOMAIN.COM”>’; ?>< ?php echo HEADER_TITLE_CATALOG; ?>< /a >< /li >

VERY IMPORTANT: Remove the spaces I have added in above before saving your file. There should be no spaces before/after this character “<” or “>”

After finishing your edits, save the file and upload to your server.

Your top menu will now appear with your link edits.

  • Share/Bookmark

Related tutorials that might interest you:

    How to edit SiteMap links in ZenCart
    How to edit the ZenCart header image
    How to edit the SiteMap text in ZenCart
    How to edit the checkout success page in ZenCart
    How to replace the ZenCart logo with your own

Tags:

5 Responses to “How to edit the top menu links in ZenCart”

  1. Robor says:

    Thank you! I would now go on this blog every day!

  2. Rox says:

    Great tip!
    I was also able to change the link to logo.gif from there.
    Very helpful.

  3. Thanks Rox! Glad the tutorial helped :)

  4. Paul Tamplin says:

    Great info – just what I was looking for
    Many thanks – I also changed the logo.gif link to my SSL Certificate Authority perfect! :)

  5. Omar says:

    Can anyone please guide me on how to set my banner/logo to fit in the width & height of the top of my header ??

    the link to my a test store :

    http://www.arab-broker.com/clothes/