Guest Posted February 22, 2003 Share Posted February 22, 2003 Hi, I have followed this code to make the name of the category show up in the main text box: In default.php change the following: Code: < td class="pageHeading"><?php echo HEADING_TITLE; ?></td> To: Code: < td class="pageHeading"><?php echo $category['categories_name']; ?></td> There are 3 occurances of this do not change the last one after: Code: } else { // default page What happens is that it does work only if a category has other categories underneath it. If a category has only products listed this will not work. An example site is : www.affairstoremember.org/catalog/ All of the categories have other categories underneath them except the stationary one. Does anyone know how to make this work with the category that only has products underneath it and also how to get the name of the sub-categories to show up in the main text area? Thanks! Link to comment Share on other sites More sharing options...
Ajeh Posted February 23, 2003 Share Posted February 23, 2003 Try this: Around line 220: <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <form> <tr> <td class="pageHeading"><?php echo HEADING_TITLE . ' ' . tep_get_categories_name($cPath); ?></td> <?php // optional Product List Filter Add this function to general.php //// // WebMakers.com Added: Find a Categories Name // TABLES: categories_description function tep_get_categories_name($who_am_i) { global $languages_id; $the_categories_name_query= tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id= '" . $who_am_i . "' and language_id= '" . $languages_id . "'"); $the_categories_name = tep_db_fetch_array($the_categories_name_query); return $the_categories_name['categories_name']; } Link to comment Share on other sites More sharing options...
Ajeh Posted February 23, 2003 Share Posted February 23, 2003 Silly me ... do it to the other 2 locations for HEADER_TITLE I was not watching my code all the way ... :shock: Link to comment Share on other sites More sharing options...
Ajeh Posted February 23, 2003 Share Posted February 23, 2003 Errr ... umm ... HEADING_TITLE ... :roll: Link to comment Share on other sites More sharing options...
Guest Posted February 23, 2003 Share Posted February 23, 2003 It works but it is adding the word "Categories" to all the listings like: Categories DVD Movies Categories Hardware Categories Software uh...how do you remove the word "Categories"? Link to comment Share on other sites More sharing options...
Ajeh Posted February 23, 2003 Share Posted February 23, 2003 That is the definition of HEADING_TITLE if I am not mistaken. Take that out or define it as '' Link to comment Share on other sites More sharing options...
Ajeh Posted February 23, 2003 Share Posted February 23, 2003 That is in the /includes/languages/english/default.php file ... :D Link to comment Share on other sites More sharing options...
Guest Posted February 23, 2003 Share Posted February 23, 2003 Gosh Linda...making me think tonight! I removed the words "Categories" and "Lets See What We have here" and each category name is listed instead. Is there a way, when you click on the sub-category, to have it say: Software Action or is this too much? Right now it says Software because it is in that category. This is really fun! Link to comment Share on other sites More sharing options...
Ajeh Posted February 23, 2003 Share Posted February 23, 2003 You'd need to look up the parent category for the current category and if not the same, then add that name on in front using the function I gave you. I think in general.php there is a function to grab the parent category id. Link to comment Share on other sites More sharing options...
Ajeh Posted February 23, 2003 Share Posted February 23, 2003 NOTE: $current_category_id works better than $cPath on the subdirectories. Might want to change that. It seems to work for me okay on my Categories Box, but was not doing a very good job on my Categories Tabs. Not sure if that will effect other things. Link to comment Share on other sites More sharing options...
Guest Posted February 23, 2003 Share Posted February 23, 2003 I think I will leave it as is. I really am lost with what you said...sorry. :( It looks nice and I think my customers will like this change. Thanks for all your help! I really appreciate it! Link to comment Share on other sites More sharing options...
Ajeh Posted February 23, 2003 Share Posted February 23, 2003 Basically the idea was use this line instead of the other: <td class="pageHeading"><?php echo HEADING_TITLE . ' ' . tep_get_categories_name($current_category_id); ?></td> The $cPath was not giving me consistant results on everything ... but that may just be the add-on I am using. Link to comment Share on other sites More sharing options...
Guest Posted February 23, 2003 Share Posted February 23, 2003 Linda, That worked great on my test site! I will change a couple of the stores to check but should be ok. I don't have many changes to my stores. Thanks again! Link to comment Share on other sites More sharing options...
Brazil Posted February 25, 2003 Share Posted February 25, 2003 Hello. How can I make the categories name show in the product info head title? I follow the instructions above and it worked, but when I click in the link in the also purchased, it don~t show. Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.