Guest Posted June 18, 2007 Share Posted June 18, 2007 Greetings, I'm just trying to have a button on my main header nav bar that says "Products" When a visitor clicks "Products" I'd like for the Categories to display in the main area of the page. Then a user would click a category and all the products from that category would come up (just like when a user currently clicks a category in subnav menu that I have in the header). Please see this page: http://70.47.23.37/ Currently, I have the "Products" button set to show all products with this code that I found on the forums: http://70.47.23.37/index.php?searchStr=&am...t&Submit=Go But that's not quite how I'd like it. I've looked all over the forums. But with no luck. I'm sure it's there. And it's probably something easy. But I can't find it. Thanks in advance for your help. P.S. Using CubeCart 3.0.10 Quote Link to comment Share on other sites More sharing options...
roban Posted June 18, 2007 Share Posted June 18, 2007 All I can come up with is a mod to show all products but you might be able to alter it: //////////////////////////////////////////////////////////////////////////////////////////////////////////// // Step 1 : Open includes/content/viewCat.inc.php /////////////////////////////////////////////////////////////////////////////////////////////////////////// Find : } elseif($_GET['catId']=="saleItems" && $config['saleMode']>0) { $productListQuery = "SELECT ".$glob['dbprefix']."CubeCart_cats_idx.cat_id, ".$glob['dbprefix']."CubeCart_cats_idx.productId, productCode, quantity, description, image, price, name, popularity, sale_price, stock_level, useStockLevel FROM ".$glob['dbprefix']."CubeCart_cats_idx INNER JOIN ".$glob['dbprefix']."CubeCart_inventory ON ".$glob['dbprefix']."CubeCart_cats_idx.productId = ".$glob['dbprefix']."CubeCart_inventory.productId WHERE sale_price > 0 GROUP BY ".$glob['dbprefix']."CubeCart_inventory.productId"; After Add: } elseif($_GET['catId']=="catalogue") { $productListQuery = "SELECT * FROM ".$glob['dbprefix']."CubeCart_inventory"; $view_cat->assign("LANG_IMAGE",$lang['front']['viewCat']['']); /******************************************************************************** ***********/ /* If You Want the pics to show go to step 2 */ /******************************************************************************** ***********/ Find : if(file_exists($GLOBALS['rootDir']."/images/uploads/thumbs/thumb_".$productResults[$i]['image'])){ $view_cat->assign("SRC_PROD_THUMB",$GLOBALS['rootRel']."images/uploads/thumbs/thumb_".$productResults[$i]['image']); } else { $view_cat->assign("SRC_PROD_THUMB",$GLOBALS['rootRel']."skins/".$config['skinDir']."/styleImages/thumb_nophoto.gif"); } Replace with : if(!$_GET['catId']=="catalogue"){ if(file_exists($GLOBALS['rootDir']."/images/uploads/thumbs/thumb_".$productResults[$i]['image'])){ $view_cat->assign("SRC_PROD_THUMB",$GLOBALS['rootRel']."images/uploads/thumbs/thumb_".$productResults[$i]['image']); } else { $view_cat->assign("SRC_PROD_THUMB",$GLOBALS['rootRel']."skins/".$config['skinDir']."/styleImages/thumb_nophoto.gif"); } } Find : $view_cat->assign("LANG_IMAGE",$lang['front']['viewCat']['image']); Replace with : if(!$_GET['catId']=="catalogue"){ $view_cat->assign("LANG_IMAGE",$lang['front']['viewCat']['image']); } //////////////////////////////////////////////////////////////////////////////////////////////////////////// // Step 2 : Open skins/YOURSKIN/styleTemplates/boxes/categories.tpl /////////////////////////////////////////////////////////////////////////////////////////////////////////// Find : <li class="bullet"><a href="index.php" class="txtDefault">{LANG_HOME}</a></li> After Add : <li class="bullet"><a href="index.php?act=viewCat&catId=catalogue" class="txtDefault">Catalogue</a></li> Quote Link to comment Share on other sites More sharing options...
Guest Posted June 19, 2007 Share Posted June 19, 2007 Thanks Roban, But I'm not finding the code you referenced in the file you referenced. Nor did I find it in any of the files of the entire includes/content/ folder. I did multiple searches using many different short bits of code you provided. Such as elseif($_GET['catId'] and CubeCart_cats_idx and config['saleMode']. Also, as mentioned in my original post, I can get the "products" link to show all products. That's what I have right now. I'd like it to show all the Category headings in the main area. Not all products. Thanks for your effort, however. If I've misunderstood something in your post, apologies. Thx. John. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.