[contact-form-7 id="24078" title="Feedback EN"]

Featured templates

osCommerce. How to edit header links

Hello! This video tutorial shows how to edit header links in your OsCommerce template.

osCommerce. How to edit header links

The tutorial assumes you are connected to your FTP or hosting control panel File Manager.

Now, let’s learn how to edit header links in your store.

1. Locate the cm_menu_header.php file in /includes/modules/boxes/ directory of your OsCommerce installation. Find the following block of code:

'<div class="menu">' . 
'  <ul>' .
'    <li class="'.$button_act1.'"><a href="' . tep_href_link(FILENAME_DEFAULT) . '"><i class="icon-home"></i>'. tep_draw_menu_top() . '' . MODULE_BOXES_MAIN_MENU_BOX_DEFAULT . '' . tep_draw_menu_bottom() . '</a></li>' .
'    <li class="'.$button_act2.'"><a href="' . tep_href_link(FILENAME_PRODUCTS_NEW) . '"><i class="icon-bullhorn"></i>' . tep_draw_menu_top() . '' . MODULE_BOXES_MAIN_MENU_BOX_PRODUCTS_NEW . '' . tep_draw_menu_bottom() . '</a></li>' .
'    <li class="'.$button_act5.'"><a href="' . tep_href_link(FILENAME_FEATURED_PRODUCTS) . '">' . tep_draw_menu_top() . '' . MODULE_BOXES_MAIN_MENU_BOX_FEATURED . '' . tep_draw_menu_bottom() . '</a></li>'.
'    <li class="'.$button_act11.'"><a href="' . tep_href_link(FILENAME_TOPSELLERS_PRODUCTS) . '">' . tep_draw_menu_top() . '' . MODULE_BOXES_MAIN_MENU_BOX_BESTSELLERS . '' . tep_draw_menu_bottom() . '</a></li>' . 
'    <li class="'.$button_act3.'"><a href="' . tep_href_link(FILENAME_SPECIALS) . '"><i class="icon-certificate"></i>' . tep_draw_menu_top() . '' . MODULE_BOXES_MAIN_MENU_BOX_SPECIALS . '' . tep_draw_menu_bottom() . '</a></li>' .
'    '.
'    <li class="'.$button_act4.'"><a href="' . tep_href_link(FILENAME_REVIEWS) . '"><i class="icon-edit"></i>' . tep_draw_menu_top() . '' . MODULE_BOXES_MAIN_MENU_BOX_REVIEWS . '' . tep_draw_menu_bottom() . '</a></li>'.
'    <li class="'.$button_act6.'"><a href="' . tep_href_link(FILENAME_CONTACT_US) . '"><i class="icon-map-marker"></i>' . tep_draw_menu_top() . '' . MODULE_BOXES_MAIN_MENU_BOX_CONTACT_US . '' . tep_draw_menu_bottom() . '</a></li>'.
'<li class="'.$button_act12.'"><a href="' . tep_href_link(FILENAME_CUSTOM_PAGE) . '">' . tep_draw_menu_top() . '' . CUSTOM_PAGE_MENU_TITLE . '' . tep_draw_menu_bottom() . '</a></li>'.
//	'		 <li class="'.$button_act7.'"><a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '">'.tep_draw_button_header_top().'<span>'.MODULE_BOXES_MAIN_MENU_BOX_ADVANCED_SEARCH.'</span>'.tep_draw_button_header_bottom().'</a></li>'.
//'		 <li class="'.$button_act8.'"><a href="' . tep_href_link(FILENAME_SHIPPING) . '">'.tep_draw_button_header_top().'<span>'.MODULE_BOXES_USER_MENU_BOX_SHIPPING.'</span>'.tep_draw_button_header_bottom().'</a></li>'. ''
'  </ul>' .
'</div>'.				

Each menu button is a list item:

 '    <li class="'.$button_act6.'"><a href="' . tep_href_link(FILENAME_CONTACT_US) . '"><i class="icon-map-marker"></i>' . tep_draw_menu_top() . '' . MODULE_BOXES_MAIN_MENU_BOX_CONTACT_US . '' . tep_draw_menu_bottom() . '</a></li>'.

2. So, let’s learn how to edit menu buttons titles.

Open the /includes/languages/english/modules/boxes/ directory on your server. The menu titles are displayed as box title variables, so there are separate files in this directory that correspond to each variable, as follows:

MODULE_BOXES_MAIN_MENU_BOX_PRODUCTS_NEW – bm_whats_new.php file;

MODULE_BOXES_MAIN_MENU_BOX_FEATURED – bm_featured.php file;

MODULE_BOXES_MAIN_MENU_BOX_BESTSELLERS – bm_best_sellers.php file;

MODULE_BOXES_MAIN_MENU_BOX_SPECIALS – bm_specials.php file;

MODULE_BOXES_MAIN_MENU_BOX_MANUFACTURERS – bm_manufacturers.php file.

MODULE_BOXES_MAIN_MENU_BOX_REVIEWS – bm_reviews.php file.

MODULE_BOXES_MAIN_MENU_BOX_CONTACT_US – cm_contact.php file.

You may edit variable values or define your own variables for new menu buttons in the cm_menu_header.php file under /includes/languages/english/modules/boxes/ directory:

  <?php
  /*
  $Id$
 osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com
 Copyright (c) 2010 osCommerce
 Released under the GNU General Public License
  */
 define('MODULE_BOXES_MAIN_MENU_TITLE', '<b class="add-by-seaman">Main Menu in Header</b>');
  define('MODULE_BOXES_MAIN_MENU_DESCRIPTION', 'Show Main Menu page links in Header');
  define('MODULE_BOXES_MAIN_MENU_BOX_TITLE', 'Main Menu');
  define('MODULE_BOXES_MAIN_MENU_BOX_DEFAULT', 'Home');
  define('MODULE_BOXES_MAIN_MENU_BOX_PRODUCTS_NEW', 'What\'s New?');
  define('MODULE_BOXES_MAIN_MENU_BOX_SPECIALS', 'Specials');
  define('MODULE_BOXES_MAIN_MENU_BOX_REVIEWS', 'Reviews');
  define('MODULE_BOXES_MAIN_MENU_BOX_CONTACT_US', 'Contacts');
  define('MODULE_BOXES_MAIN_MENU_BOX_ADVANCED_SEARCH', 'Advanced Search'); 
  define('MODULE_BOXES_MAIN_MENU_BOX_TITLE_LOGIN', 'Log in');
  define('MODULE_BOXES_MAIN_MENU_BOX_TITLE_LOGOFF', 'Log off');
  define('MODULE_BOXES_MAIN_MENU_BOX_MY_ACCOUNT', 'My Account');
  define('MODULE_BOXES_MAIN_MENU_BOX_CREATE_ACCOUNT', 'Create an Account');
  define('MODULE_BOXES_MAIN_MENU_BOX_SHIPPING', 'Shipping & Returns');
  define('MODULE_BOXES_MAIN_MENU_BOX_FEATURED', 'Featured');
  define('MODULE_BOXES_MAIN_MENU_BOX_ADVANCED_SEARCH', 'Advanced Search');
  define('MODULE_BOXES_MAIN_MENU_BOX_MANUFACTURERS', 'Brands');
  define('MODULE_BOXES_MAIN_MENU_BOX_BESTSELLERS', 'Top sellers'); 
  
  ?>

Just edit desired button title by changing the text inside ‘ ‘ quotes, e.g. ‘Specials’ . You may also add your own button variable using the same syntax, e.g.:

define(‘MODULE_BOXES_MAIN_MENU_BOX_NEW_BUTTON’, ‘New Button’);

3. Now, let’s learn how to edit menu buttons links.

In order to edit menu link, e.g. Contact Us menu button link, change the following variable in your cm_menu.php file:

‘ . tep_href_link(FILENAME_CONTACT_US) . ‘

Link variables values may be found in the filenames.php file under /includes/ folder:

define('FILENAME_CONTACT_US', 'contact_us.php');

As you can see, the button is linked to contact_us.php file. You may either create your own page using this tutorial or link the button to any desired URL by replacing ‘ . tep_href_link(FILENAME_CONTACT_US) . ‘ with your own URL.

This is the end of the tutorial, you have learnt how to edit header links in OsCommerce templates.

Feel free to check the detailed video tutorial below:

osCommerce. How to edit header links

  • Thanks you. I just found what I need. Really helpful for osCommerce menu modify.

  • thanks for this help me very much !