gambitdis Posted May 12, 2003 Posted May 12, 2003 What's the best way to remove "Let's See What We Have Here" in the product listing page and instead replacing it with the category name. We have a site live here: http://madelinescandles.com/ that I would love to change that on. Thanks. --derek
omps Posted May 12, 2003 Posted May 12, 2003 look in CATALOG/INCLUDES/LANGUAGES/ENGLISH/DEFAULT.PHP live long and prosper
gambitdis Posted May 12, 2003 Author Posted May 12, 2003 I'm trying to make it dynamic though. I want it to be changed to the current category name. Any ideas on how to do that? Thanks. --derek
Guest Posted May 15, 2003 Posted May 15, 2003 On linux: cd into the catalog directory and search for the string this way: find . -name "*.php" -print | xargs grep "Let's See What We Have Here" this will give you the symbol for that string. Then: find . -name "*.php" -print | xargs grep "the symbol you found" this will give you all places this string is displayed in the html Then use a similar technique to find where the current cataegory name is pulled out of the database and teach yourself how that works. Then insert that code (slightly modified) into the files at the places where the static string used to be output. Then write a contribution. Or, hire a programmer to do all the above (maybe bribing with chocolate is a good method) :) Hope that helps.
GaryM Posted May 17, 2003 Posted May 17, 2003 I'm trying to make it dynamic though. I want it to be changed to the current category name. Any ideas on how to do that? Thanks. This is a big replacement to your shop/default.php file that I picked up somewhere and logged in my personal "changes" document. If it doesn't work for you, sorry. As always, back up your working files first. On line 228 there is an occurance of: <?php echo HEADING_TITLE; ?> Change THAT to: <?php if ($cPath) { if (!ereg('_', $cPath)) { $cPath_array = array($cPath); } $cPath_new = ''; for($i=0; $i<sizeof($cPath_array); $i++) { if ($cPath_new == '') { $cPath_new .= $cPath_array[$i]; } else { $cPath_new .= '_' . $cPath_array[$i]; } $categories_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . $cPath_array[$i] . "' and language_id='" . $languages_id . "'"); $categories = tep_db_fetch_array($categories_query); echo $categories['categories_name']; } } elseif ($HTTP_GET_VARS['manufacturers_id']) { $manufacturers_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . $HTTP_GET_VARS['manufacturers_id'] . "'"); $manufacturers = tep_db_fetch_array($manufacturers_query); echo $manufacturers['manufacturers_name']; } if ($HTTP_GET_VARS['products_id']) { $model = tep_db_query("select products_model from " . TABLE_PRODUCTS . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "'"); $model_values = tep_db_fetch_array($model); echo $model_values['products_model']; } if ($location) { echo $location; } ?> Have you ever gotten any help from these forums? Be part of the community and help out by answering a question or 2. Pass on what you know about OSC to someone who needs help.
Irata0062 Posted May 17, 2003 Posted May 17, 2003 Hi GaryM, that worked nice for me, except it goes catagorysubcatagory without a space between the words. Do you know how to add that in?
GaryM Posted May 18, 2003 Posted May 18, 2003 Hi GaryM, that worked nice for me, except it goes catagorysubcatagory without a space between the words. Do you know how to add that in? I don't, and if somebody does, I'd be interested in hearing it. What I ended up doing was to alter the way I format my subcategory names. So my sub cats use the following format: " - Subcategory" It's obviously not the best solution. I can deal with the " - " everywhere except up in the breadcrumb, where I think it looks dorky. Have you ever gotten any help from these forums? Be part of the community and help out by answering a question or 2. Pass on what you know about OSC to someone who needs help.
GaryM Posted May 18, 2003 Posted May 18, 2003 Hey Seth, here's something you can try Change: echo $categories['categories_name']; TO: echo ' - ' .$categories['categories_name']; This adds a space and a hyphen between your category and your subcategory in the description, but NOT in the breadcrumb and NOT in the categories box. That's the upside. The downside is that it adds the hyphen BEFORE the ROOT category on your category page as well. It'd be nice if it would only add a hyphen between the root category and the sub category, but I don't know anything about PHP and I'm just muddling my way through it. Have you ever gotten any help from these forums? Be part of the community and help out by answering a question or 2. Pass on what you know about OSC to someone who needs help.
DavidR Posted May 19, 2003 Posted May 19, 2003 This contribution worked great for me: http://www.oscommerce.com/community/contributions,778. HTH, David
gambitdis Posted May 19, 2003 Author Posted May 19, 2003 The above code worked perfectly for me. Note that I only have one level of categories so I didn't run into the spacing problem. Thanks!! --derek
GaryM Posted May 19, 2003 Posted May 19, 2003 This contribution worked great for me: http://www.oscommerce.com/community/contributions,778. HTH, David Thanks. If I'm looking at this right it uses whatever's in the breadcrumb to be your heading. Pretty smart thinkin! :) Thanks Have you ever gotten any help from these forums? Be part of the community and help out by answering a question or 2. Pass on what you know about OSC to someone who needs help.
CodeConfused Posted June 17, 2003 Posted June 17, 2003 when trying to use this contribution, i get the following error: Fatal error: Call to undefined function: tep_last() in /home/www.mydomain.com/html/catalog/default.php on line 237 i have the function defined in breadcrump.php... any ideas what this could be? i'm using 2.2CVS May 18, 2003 snapshot thanks much! dan
DavidR Posted June 17, 2003 Posted June 17, 2003 I used it on a CVS from just a few days ago and it worked fine. Make sure you are adding the function to the class, and not after it. I have posted my entire breadcrumb.php with comments around the addition for this contribution. See if that helps. David <?php /* $Id: breadcrumb.php,v 1.3 2003/02/11 00:04:50 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ class breadcrumb { var $_trail; function breadcrumb() { $this->reset(); } function reset() { $this->_trail = array(); } function add($title, $link = '') { $this->_trail[] = array('title' => $title, 'link' => $link); } function trail($separator = ' - ') { $trail_string = ''; for ($i=0, $n=sizeof($this->_trail); $i<$n; $i++) { if (isset($this->_trail[$i]['link']) && tep_not_null($this->_trail[$i]['link'])) { $trail_string .= '<a href="' . $this->_trail[$i]['link'] . '" class="headerNavigation">' . $this->_trail[$i]['title'] . '</a>'; } else { $trail_string .= $this->_trail[$i]['title']; } if (($i+1) < $n) $trail_string .= $separator; } return $trail_string; } // BOF: Dynamic Category Fix function last() { $trail_size = sizeof($this->_trail); return $this->_trail[$trail_size-1]['title']; } // EOF: Dynamic Category Fix } ?>
joekilo Posted June 20, 2003 Posted June 20, 2003 hello i have just followed the contribution instructions from above but has exactly worked instead of putting a catorgorie nane on my screen it puts the breadcrumbs last section from this line in default page that i had to change <td class="pageHeading">< $breadcrumb->last().></td> can any see what ive done wrong...ive changed the breadcrumb php correctly i think jk
DavidR Posted June 20, 2003 Posted June 20, 2003 I don't think you followed the instructions :o. The line should look like: <td class="pageHeading"><?php echo $breadcrumb->last(); ?></td> David
joekilo Posted June 20, 2003 Posted June 20, 2003 thanks for gettin back i tried it that way also but got an error on that line....does any changes need to be made in english/default.php ? jk
Mooligan Posted July 17, 2003 Posted July 17, 2003 Just stumbled across this contrib. Followed the very short instructions and works just great on 2.2MS2
Hunkah Posted July 18, 2003 Posted July 18, 2003 Try this, it works like a charm! http://www.oscommerce.com/forums/viewtopic.php?t=51263 Read where I made the CODE postings.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.