PDA

View Full Version : Dynamic SiteMap V 1.0



michael_s
07-06-2007, 05:24 PM
If you want to have category links to be suitable and compatible with breadcrumb and other contribs (like some categories box enhancments and similar), which means to have complete links including the parent categories, you just need to make these few minor changes included below.

AUTHORS: wizaard (if) and funous (the others) ;)

-------------------------------------------------------------
HOW TO?
CHANGES TO catalog/includes/classes/category_tree.php
-------------------------------------------------------------
REPLACE:
function buildBranch($parent_id, $level = 0) {
WITH:
function buildBranch($parent_id, $level = 0, $p_category_link = false) {

ADD BELOW FOREACH FUNCTION (around line 23):
if ($parent_id == '0') {
$category_link = $category_id;
} else {
$category_link = $p_category_link . '_' . $category_id;
}

REPLACE:
$result .= $this->buildBranch($category_id, $level+1);}
WITH:
$result .= $this->buildBranch($category_id, $level+1, $category_link);}

---------------------------------------------------------------
THE END, ENJOY

More... (http://www.oscommerce.com/community/contributions,3306)