Hey there,
I would like to preserve in my sidebar navigation the ability to click at anytime the subcategory to be able to go back to the product array (i.e. the page with all the products photos in their respective sub-category). Right now when a customer is in a product detail page, the sidebar navigation link to go back is turned off with a "javascript:void(0)"
Since I'm not very good with php, how would I change the line of code in the "categories_ul_generator.php" file so it doesn't create a null link? Thanks for any help!
Code:
function buildBranch($parent_id, $level = 0, $cpath = '') {
global $cPath;
$result = "\n".sprintf($this->parent_group_start_string, str_repeat(' ', $level*4))."\n";
if (isset($this->data[$parent_id])) {
foreach ($this->data[$parent_id] as $category_id => $category) {
$result .= sprintf($this->child_start_string, str_repeat(' ', $level*4+2));
if (isset($this->data[$category_id])) {
$result .= $this->parent_start_string;
}
if ($level == 0) {
$result .= $this->root_start_string;
$new_cpath = $category_id;
} else {
$new_cpath = $cpath."_".$category_id;
}
if ($cPath == $new_cpath) {
$result .= '<a href="javascript:void(0)" class="on">'; // highlight current category & disable link
} else {
$result .= '<a href="' . zen_href_link(FILENAME_DEFAULT, 'cPath=' . $new_cpath) . '">';
}
$result .= $category['name'];
if (SHOW_COUNTS == 'true' && ((CATEGORIES_COUNT_ZERO == '1' && $category['count'] == 0) || $category['count'] >= 1)) {
$result .= CATEGORIES_COUNT_PREFIX . $category['count'] . CATEGORIES_COUNT_SUFFIX;
}
$result .= '</a>';
if ($level == 0) {
$result .= $this->root_end_string;
}
if (isset($this->data[$category_id])) {
$result .= $this->parent_end_string;
}
if (isset($this->data[$category_id]) && (($this->max_level == '0') || ($this->max_level > $level+1))) {
$result .= $this->buildBranch($category_id, $level+1, $new_cpath);
$result .= sprintf($this->child_end_string, str_repeat(' ', $level*4+2))."\n";
} else {
$result .= sprintf($this->child_end_string, '')."\n";
}
}
}
$result .= sprintf($this->parent_group_end_string, str_repeat(' ', $level*4))."\n";
return $result;
}
Bookmarks