- Web templates
- E-commerce Templates
- CMS & Blog Templates
- Facebook Templates
- Website Builders
osCommerce 2.3. How to edit user menu
July 7, 2011
This tutorial will show you how to edit header user menu in osCommerce 2.3 templates.
Locate menu file
- Open your osCommerce installation directory
- Go to includes\modules\boxes directory
- Open hm_user_menu.php file with your PHP editor
The header user menu is created using the unordered list layout.
$data = '';
Each menu button is a list item:
'
Edit button titles
As you can see the menu item titles are created using the PHP variables like $acc_title and $login_title. Investigating the includes\modules\boxes\hm_user_menu.php file you can find the variable values:
$acc_link = tep_href_link('account.php'); $acc_title= MODULE_BOXES_USER_MENU_BOX_MY_ACCOUNT; } else{ $acc_link = tep_href_link('create_account.php'); $acc_title= MODULE_BOXES_USER_MENU_BOX_CREATE_ACCOUNT; }
$login_link = tep_href_link('logoff.php'); $login_title= MODULE_BOXES_USER_MENU_BOX_TITLE_LOGOFF; } else{ $login_link = tep_href_link('login.php'); $login_title= MODULE_BOXES_USER_MENU_BOX_TITLE_LOGIN; }
To change the button titles you need to edit the language variables MODULE_BOXES_USER_MENU_BOX_MY_ACCOUNT, MODULE_BOXES_USER_MENU_BOX_CREATE_ACCOUNT etc.
You can modify them in the includes\languages\english\modules\boxes\hm_user_menu.php file
define('MODULE_BOXES_USER_MENU_TITLE', 'User Menu in Header'); define('MODULE_BOXES_USER_MENU_DESCRIPTION', 'Show User Menu page links in Header'); define('MODULE_BOXES_USER_MENU_BOX_TITLE', 'User Menu'); define('MODULE_BOXES_USER_MENU_BOX_TITLE_LOGIN', 'Log in'); define('MODULE_BOXES_USER_MENU_BOX_TITLE_LOGOFF', 'Log off'); define('MODULE_BOXES_USER_MENU_BOX_MY_ACCOUNT', 'My Account'); define('MODULE_BOXES_USER_MENU_BOX_CREATE_ACCOUNT', 'Create an Account'); define('MODULE_BOXES_USER_MENU_BOX_SHIPPING', 'Shipping & Returns');
You can modify the variable values or define your own variables.
Edit button links
As you can see the menu item links are created using the PHP variables like$acc_link and $login_link. The same way as for the button titles the variable values could be found in includes\modules\boxes\hm_user_menu.php file:
$acc_link = tep_href_link('account.php'); $acc_title= MODULE_BOXES_USER_MENU_BOX_MY_ACCOUNT; } else{ $acc_link = tep_href_link('create_account.php'); $acc_title= MODULE_BOXES_USER_MENU_BOX_CREATE_ACCOUNT; }
$login_link = tep_href_link('logoff.php'); $login_title= MODULE_BOXES_USER_MENU_BOX_TITLE_LOGOFF; } else{ $login_link = tep_href_link('login.php'); $login_title= MODULE_BOXES_USER_MENU_BOX_TITLE_LOGIN; } You can also see the page filenames the buttons are linked to.
You can add your variables and add your page using the tutorial on how to add new page to osCommerce store.