Tom Muck

Alpha Dog Blues Band
Home page
All articles
All Extensions | Extension News | Extension FAQs | Customer Login
Books authored or co-authored by Tom Muck
Extensions, books, and other products | Customer Login
Your current cart contents
Tom-Muck.com Blog | CMXTraneous Blog | Flash Remoting Blog
About the site

Search Using List

Create an unordered list for search links

There is not a way to do this using Cartweaver out of the box, but with a simple modification of CWSearch.php you can do it. Find the switch/case section and add a new case statement. Currently there is a case "LINKS" and a case "FORM". Add this case statement immediately after the switch line:

/* SEARCH BY LIST */
case "LIST":
echo("<ul>");
if($this->allcategorieslabel != "") {
echo("<li><a href=\"" . $this->actionpage . "?category=0\">" . $this->allcategorieslabel . "</a></li>");
}
while ($row_rsCWGetCategories = $this->db->db_fetch_assoc($rsCWGetCategories)) {
if($this->urlcategory == $row_rsCWGetCategories['category_ID']) {
echo($this->selectedStart);
}
echo("<li><a href=\"" . $this->actionpage . "?category=" . $row_rsCWGetCategories['category_ID'] . "\">" . $row_rsCWGetCategories['category_Name'] . "</a></li>");
}
echo("</ul>");
break;

Then, on any page where you want to use the list, call it like this:

<?php
$cwSearchObj = new CWSearch($cartweaver);
$cwSearchObj->setSearchType("LIST");
$cwSearchObj->setCategory("YES");
$cwSearchObj->setAllCategoriesLabel("All Products");
$cwSearchObj->display();
?>

Back to Cartweaver PHP FAQ, code changes, and samples

Pay me securely with your Visa, MasterCard, Discover, or American Express card through PayPal!
Pay me securely with your Visa, MasterCard, Discover, or American Express card through PayPal!
About | Privacy Policy | Contact | License Agreement | ©2002-2025 Tom Muck | Dreamweaver Extensions