Add sale, all, new, featured links to list navigation (v. 2.81)
Version 2.81 systems have a new navigation type - %CATEGORY_LIST% (/enc/navbar_lists.php) which allows you to display your category links in a nested, unordered list format (i.e.
- link
However, this link method does not allow you to view links to sale items, all items, new items or feature items within the unordered list. This will be added in the next release. For now, you can apply the following changes to add these links, to show these links. Please note: this modification will only show text; it will not show images for new, sale, featured or all product links:
-
Open the stconfig.php file in the main public folder.
-
Change the line:
function setcategories($parent, $currentid, $currentparent, $indentval, $subindent, $surroundcode, $navname, $catlevel, $catisfirst, $baseclass, $showinactive, $showimages, $showmainonly)
to:
function setcategories($parent, $currentid, $currentparent, $indentval, $subindent, $surroundcode, $navname, $catlevel, $catisfirst, $baseclass, $showinactive, $showimages, $showmainonly, $extralinks='')
-
Change the line:
setcategories($catrow[ID], $currentid, $currentparent, $indentval, $subindent, $surroundcode, $navname, $catlevel+1, $catisfirst, $baseclass, $showinactive, $showimages, $showmainonly);
to:
setcategories($catrow[ID], $currentid, $currentparent, $indentval, $subindent, $surroundcode, $navname, $catlevel+1, $catisfirst, $baseclass, $showinactive, $showimages, $showmainonly, $extralinks);
-
Change the lines:
if ($cc == $catnum) echo " ";
to:
if ($cc == $catnum) { if($catlevel==0 AND !empty($extralinks)) echo $extralinks; echo " "; } - Open the navbar_lists.php file in the /enc/ folder.
-
Remove the lines:
setcategories($parentcat, $usecatval, 0, " ", "", "
- [%%INDENT%%][%%DISPLAY%%]", "listcat", 0, 0, "catcolor", "no", "yes", $showmnonly);
-
Add the lines:
// ADDITIONAL LINKS - NEW, FEATURED, SALES, ALL $add_additional_links = '';
just above the line:
// ADD NEW PRODUCT LINK
-
Change the line:
additionalLinks("new", $newnavimg, "New Items", "catcolor");to:
$add_additional_links .= "
- New Items ";
-
Change the line:
additionalLinks("featured", $featurednavimg, "Featured Items", "catcolor");to:
$add_additional_links .= "
- Featured Items ";
-
Change the line:
additionalLinks("sale", $salenavimg, "Sale Items", "catcolor");to:
$add_additional_links .= "
- Sale Items ";
-
Change the line:
additionalLinks("all", $allnavimg, "All Items", "catcolor");to:
$add_additional_links .= "
- All Items "; setcategories($parentcat, $usecatval, 0, " ", "", "
- [%%INDENT%%][%%DISPLAY%%]", "listcat", 0, 0, "catcolor", "no", "yes", $showmnonly, $add_additional_links);
-
Save and reload all files.