natster Posted September 24, 2005 Posted September 24, 2005 Hi All, A friend of mine has asked to move a few menu items around. I thought it would be simply HTML, but they are using this system and am struggling to sort thru the masses of includes etc. Basically, they want to move some top menu items to the left column. I have found the header.php for the top items, but can't find the php file that contains the information for the left column, i.e. the actual HTML. I looked through and found column_left.php which spits out the categories, but not the rest of the left side. Can someone please explain the basic framework structure and how things all fit in. Is there a parent template .php file somewhere that calls all these includes? I am reluctant to change anything in case I screw something else up within the structure. Any help appreciated. Thanks, Nat
hall2005 Posted October 5, 2005 Posted October 5, 2005 i need to do the exact same thing, i can edit the header the footer and the layout on the index fine but i dont have a clue when i go into the includes folder for the menus and stuff. i really like this shopping cart tho and if i could finfd the html code for the menus i think id be able to lay it out just fine.......... so if any 1 could help us out it would be really apreciated :-" :blush: :thumbsup:
VectorSix Posted October 5, 2005 Posted October 5, 2005 Hahahaha. Sorry, I am just glad someone else has felt my pain. If it was straight HTML my grandmother could do it :). It is pretty much an interwoven organized mess. The column_left.php contains the entire left side. Let's take a look at it: <?php /* $Id: column_left.php,v 1.15 2003/07/01 14:34:54 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_categories_box(); } else { include(DIR_WS_BOXES . 'categories.php'); } if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_manufacturers_box(); } else { include(DIR_WS_BOXES . 'manufacturers.php'); } require(DIR_WS_BOXES . 'whats_new.php'); require(DIR_WS_BOXES . 'search.php'); require(DIR_WS_BOXES . 'information.php'); ?> The rest of your left side is contained in the require statements. IE: require(DIR_WS_BOXES . 'whats_new.php'); In order to see whats_new.php, then you need to go to the /catalog/includes/boxes folder. How do I know to look here? Well, look at /includes/configure.php: define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/'); Ok, so, we know the directory (boxes) and filename (whats_new.php). Groovy, almost there. Well, not quite. Let's say you want to change something, information.php. Let's look at information.php: <?php /* $Id: information.php,v 1.6 2003/02/10 22:31:00 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ ?> <!-- information //--> <tr> <td> <?php $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_INFORMATION); new infoBoxHeading($info_box_contents, false, false); $info_box_contents = array(); $info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a><br>' . '<a href="' . tep_href_link(FILENAME_PRIVACY) . '">' . BOX_INFORMATION_PRIVACY . '</a><br>' . '<a href="' . tep_href_link(FILENAME_CONDITIONS) . '">' . BOX_INFORMATION_CONDITIONS . '</a><br>' . '<a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</a>'); new infoBox($info_box_contents); ?> </td> </tr> <!-- information_eof //--> Any of that look like what is in the information box? Didn't think so. The keys here are the capitalized values, such as BOX_INFORMATION_PRIVACY and FILENAME_PRIVACY. Hmm, ok, so where are they? Good question. Look in catalog/includes/languages/english.php. You will find BOX_INFORMATION_PRIVACY in there somewhere: define('BOX_INFORMATION_PRIVACY', 'Privacy & Security'); So where is FILENAME_PRIVACY declared? Look back in the /catalog/includes folder. You will see a file called filenames.php. Contained in that file you will see a line like this: define('FILENAME_PRIVACY', 'privacy.php'); Aha! So, if I want to change where the Privacy link in the Information box goes, I need to go through all that? Short answer, yes. Once you get the hang of it a little, it starts to make sense. You can change the heading in the languages/english.php file: define('BOX_INFORMATION_PRIVACY', 'This Goes Nowhere'); or change where the link goes define('FILENAME_PRIVACY', 'nowhere.php'); There, now it will go nowhere. Confused yet? Hope this helps somewhat. Start poking around, you'll figure it out. By the way, don;t forget to backup the entire catalog directory before you start dinking around :) Happy hacking.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.