How to easily add a ‘Bookmark Us’ link
November 8, 2008 in Zen Cart Customization
Is this useful? Like it.
You can easily add a ‘Bookmark Us’ link to anywhere on your Zen Cart e-commerce website. This post will show you the steps to add/append a ‘Bookmark Us’ link to the top navigation links.
The code
You just need to add a small block of code to your template’s tpl_header.php file. The file is located at:
includes\templates\YOUR_TEMPLATE\common\tpl_header.php
<!-- START BOOKMARK LINK --> <script language="javascript"> <!-- function bookmarksite(title, url) { if (document.all) window.external.AddFavorite(url, title); else if (window.sidebar) alert("Press Ctrl D keys to bookmark our site"); } //--> </script> <li><a href="javascript:bookmarksite('Yoursite.com','http://www.yoursite.com')">Bookmark Us</a></li> <!-- END BOOKMARK LINK -->
You can copy the block of code above or from the downloaded sample file below.
The Steps
- Download the sample tpl_header.php file >> HERE << (DO NOT REPLACE your original file with this — it’s only meant for reference)
- Unzip and open the downloaded file with any text editor (even Windows Notepad is okay)
- Copy the block of code between ‘START BOOKMARK LINK’ and ‘END BOOKMARK LINK’ (line 66 to 80)
- Open your own tpl_header.php file in another text editor window. Your own file should be in:
includes\templates\YOUR_TEMPLATE\common\tpl_header.php - Paste the code to the same location of your own tpl_header.php file.
- The block of code is for a sample URL (yoursite.com) — Replace with your own URL
- Save.
You can move the link to any location on your web page if you do not want it to be appended to the end of your top navigation bar.
The code is just Javascript and HTML. Therefore, you can reuse the code for ANY static HTML or dynamic web page, not just for Zen Cart.
Note:
This is a quick and easy way to add a ‘Bookmark Us’ link to your Zen Cart online store, without using the language file. So, even if you have additional language packs, the link will always be displayed in the language you used for for editing tpl_header.php file.
Zen Cart Version: 1.3.8 (the code and method can be used for any other version)
Comments
2 Responses to “How to easily add a ‘Bookmark Us’ link”
Leave a Reply





















Thanks for the coding - added a little umpf to my site! And making it look more professional! Love it - I created it under the EZPages. Worked out great!!! Thank you again!
Thanks for the code it worked great first time and was easier to include than I thought possible.