{"id":9519,"date":"2011-07-07T02:04:31","date_gmt":"2011-07-07T06:04:31","guid":{"rendered":"http:\/\/info.template-help.com\/?p=9519"},"modified":"2013-01-15T10:08:21","modified_gmt":"2013-01-15T15:08:21","slug":"oscommerce-2-3-how-to-edit-user-menu","status":"publish","type":"post","link":"https:\/\/www.templatemonster.com\/help\/oscommerce-2-3-how-to-edit-user-menu.html","title":{"rendered":"osCommerce 2.3. How to edit user menu"},"content":{"rendered":"<p>This  tutorial will show you how to edit header user menu in osCommerce 2.3 templates. <\/p>\r\n\r\n\r\n<p>&nbsp;<\/p>\r\n<h3>Locate menu file<\/h3>\r\n<ol>\r\n  <li>Open  your osCommerce installation directory<\/li>\r\n  <li>Go  to <strong>includes\\modules\\boxes <\/strong>directory<\/li>\r\n  <li>Open <strong>hm_user_menu.php<\/strong> file with your PHP  editor<\/li>\r\n<\/ol>\r\n<p>The header user menu is created using the  unordered list layout. <\/p>\r\n\r\n<pre class=\"brush:php\">      \r\n$data = '&lt;ul class=&quot;user_menu&quot;&gt;'.\r\n\t'&lt;li class=&quot;'.$button_act2.'&quot;&gt;&lt;a href=&quot;' .$acc_link. '&quot;&gt;'.tep_draw_button_header_top().'&lt;span&gt;'.$acc_title.'&lt;\/span&gt;'.tep_draw_button_header_bottom().'&lt;\/a&gt;&lt;\/li&gt;'.\r\n    \r\n\t'&lt;li class=&quot;'.$button_act1.'&quot;&gt;&lt;a href=&quot;'.$login_link.'&quot;&gt;'.tep_draw_button_header_top().'&lt;span&gt;'.$login_title.'&lt;\/span&gt;'.tep_draw_button_header_bottom().'&lt;\/a&gt;&lt;\/li&gt;'.\r\n         '&lt;\/ul&gt;';\r\n<\/pre>\r\n\r\n<p>Each menu button is a list item:<\/p>\r\n\r\n<pre class=\"brush:php\">\r\n\t'&lt;li class=&quot;'.$button_act1.'&quot;&gt;&lt;a href=&quot;'.$login_link.'&quot;&gt;'.tep_draw_button_header_top().'&lt;span&gt;'.$login_title.'&lt;\/span&gt;'.tep_draw_button_header_bottom().'&lt;\/a&gt;&lt;\/li&gt;'.\r\n<\/pre>\r\n\r\n<p>&nbsp;<\/p>\r\n<h3>Edit button titles<\/h3>\r\n\r\n<p>As you can see the menu item titles are created using the PHP variables like <strong>$acc_title<\/strong> and <strong>$login_title. <\/strong> Investigating the <strong>includes\\modules\\boxes\\hm_user_menu.php <\/strong>file you can find the variable values:\r\n\r\n<pre class=\"brush:php\">\r\n $acc_link = tep_href_link('account.php');\r\n<strong>$acc_title= MODULE_BOXES_USER_MENU_BOX_MY_ACCOUNT;<\/strong>\r\n} else{ \r\n$acc_link = tep_href_link('create_account.php');\r\n<strong>$acc_title= MODULE_BOXES_USER_MENU_BOX_CREATE_ACCOUNT;<\/strong>\r\n} \r\n<\/pre>\r\n\r\n<pre class=\"brush:php\"> $login_link = tep_href_link('logoff.php');\r\n<strong>$login_title= MODULE_BOXES_USER_MENU_BOX_TITLE_LOGOFF;<\/strong>\r\n} else{ \r\n$login_link = tep_href_link('login.php');\r\n<strong>$login_title= MODULE_BOXES_USER_MENU_BOX_TITLE_LOGIN;<\/strong>\r\n} \r\n<\/pre>\r\n\r\n<p>To change the button titles you need to edit the language variables <strong>MODULE_BOXES_USER_MENU_BOX_MY_ACCOUNT<\/strong>, <strong>MODULE_BOXES_USER_MENU_BOX_CREATE_ACCOUNT<\/strong> etc.<\/p> \r\n\r\n<p>You can modify them in the <strong>includes\\languages\\english\\modules\\boxes\\hm_user_menu.php<\/strong> file<\/p>\r\n\r\n<pre class=\"brush:php\">  define('MODULE_BOXES_USER_MENU_TITLE', 'User Menu in Header');\r\n  define('MODULE_BOXES_USER_MENU_DESCRIPTION', 'Show User Menu page links in Header');\r\n  define('MODULE_BOXES_USER_MENU_BOX_TITLE', 'User Menu');\r\n  define('MODULE_BOXES_USER_MENU_BOX_TITLE_LOGIN', 'Log in');\r\n  define('MODULE_BOXES_USER_MENU_BOX_TITLE_LOGOFF', 'Log off');\r\n  define('MODULE_BOXES_USER_MENU_BOX_MY_ACCOUNT', 'My Account');\r\n  define('MODULE_BOXES_USER_MENU_BOX_CREATE_ACCOUNT', 'Create an Account');\r\n  define('MODULE_BOXES_USER_MENU_BOX_SHIPPING', 'Shipping &amp; Returns');\r\n<\/pre>\r\n\r\n<p>You can modify the variable values or define your own variables. <\/p>\r\n<p>&nbsp;<\/p>\r\n<h3>Edit button links<\/h3>\r\n<p>As you can see the menu item links are created using the PHP variables like<strong>$acc_link<\/strong> and <strong>$login_link. <\/strong> The same way as for the button titles the variable values could be found in <strong>includes\\modules\\boxes\\hm_user_menu.php <\/strong>file: <\/p>\r\n<pre class=\"brush:php\">\r\n<strong> $acc_link = tep_href_link('account.php');<\/strong>\r\n$acc_title= MODULE_BOXES_USER_MENU_BOX_MY_ACCOUNT;\r\n} else{ \r\n<strong>$acc_link = tep_href_link('create_account.php');<\/strong>\r\n$acc_title= MODULE_BOXES_USER_MENU_BOX_CREATE_ACCOUNT;\r\n} \r\n<\/pre>\r\n<pre class=\"brush:php\"><strong> $login_link = tep_href_link('logoff.php');<\/strong>\r\n$login_title= MODULE_BOXES_USER_MENU_BOX_TITLE_LOGOFF;\r\n} else{ \r\n<strong>$login_link = tep_href_link('login.php');<\/strong>\r\n$login_title= MODULE_BOXES_USER_MENU_BOX_TITLE_LOGIN;\r\n} \r\n\r\nYou can also see the page filenames the buttons are linked to. <\/pre>\r\n\r\n<p> You can add your variables and add your page using the tutorial on <a href=\"\/help\/how-add-new-page-2.html\">how to add new page to osCommerce store<\/a>. <\/p>\r\n<p>&nbsp;<\/p>","protected":false},"excerpt":{"rendered":"<p>This tutorial will show you how to edit header user menu in osCommerce 2.3 templates. &nbsp; 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 = &#8216;&lt;ul class=&quot;user_menu&quot;&gt;&#8217;. &#8216;&lt;li class=&quot;&#8217;.$button_act2.&#8217;&quot;&gt;&lt;a href=&quot;&#8217; .$acc_link. &#8216;&quot;&gt;&#8217;.tep_draw_button_header_top().'&lt;span&gt;&#8217;.$acc_title.'&lt;\/span&gt;&#8217;.tep_draw_button_header_bottom().'&lt;\/a&gt;&lt;\/li&gt;&#8217;. [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[731],"tags":[627,571,538,883],"_links":{"self":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/9519"}],"collection":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/comments?post=9519"}],"version-history":[{"count":0,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/9519\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media?parent=9519"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/categories?post=9519"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/tags?post=9519"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}