jeffy777 Posted September 18, 2005 Posted September 18, 2005 Is it possible to have sections within Categories? I'm not talking about Sub-categories, but what I would like to see is on the product listing if it were divided up into different sections wiht headings for each one. Is there a contrib for this?
jeffy777 Posted September 18, 2005 Author Posted September 18, 2005 Anyone? Is it atleast possible to show all the products in the category and it's sub-cats on one page in a sectioned format?
Guest Posted September 18, 2005 Posted September 18, 2005 hi jeff, You could try a bit the all products contribution and modify the code to list only the products under the current category and sub-cats.
jeffy777 Posted September 18, 2005 Author Posted September 18, 2005 That actually sounds like a good solution, but I'm not sure I'm advanced enough to do it .
Guest Posted September 18, 2005 Posted September 18, 2005 install the all products contrib then define a var say $test_cat at the beginning of the all products file in the php section like say: $test_cat = 11; where 11 is an arbitrary id that in your case should match a real category id (pick a top one from your admin you could change the number later for subs for testing) locate the query in that file, must be something like ?$included_categories_query = tep_db_query("SELECT c.categories_id, c.parent_id, c.categories_image, cd.categories_name FROM " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd WHERE c.categories_id = cd.categories_id AND cd.language_id = FLOOR($languages_id)"); modify it to add an extra test for the test_cat ?$included_categories_query = tep_db_query("SELECT c.categories_id, c.parent_id, c.categories_image, cd.categories_name FROM " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd WHERE c.categories_id = cd.categories_id and c.categories_id = '" . (int)$test_cat . "' AND cd.language_id = FLOOR($languages_id)"); then format your html code align/set the cat tables nicely till you're happy with it. Finally drop the $test_cat and use the $current_category_id global var in its place, add the php code as a new module to be included from the index.php much like the product_listing.php is done.
jeffy777 Posted September 18, 2005 Author Posted September 18, 2005 wow, thanks for doing that :thumbsup: I'm going to give it a try!
jeffy777 Posted September 19, 2005 Author Posted September 19, 2005 Hi enigma1, I made the changes to the all products file as you described (defining the var and changed the query), but now it only displays all the products from the category and sub-cats, but it doesn't display the category/sub-cat names. Did I do something wrong?
Guest Posted September 20, 2005 Posted September 20, 2005 hmm.. shouldn't be the query, it includes the cat name, so can you locate where it stores it? must be like a ['categories_name'] somewhere. Should also be a loop for the products can you add the category name just before each loop?
jeffy777 Posted September 20, 2005 Author Posted September 20, 2005 Another weird thing is that it still seems to display products from all categories instead of just the one I specified when I defined the var. Did you get your all_products.php to just display products from the category (and it's sub-cats) you definedin the var? I really appreciate your help :)
Guest Posted September 20, 2005 Posted September 20, 2005 yes that code will display products from the specified category and products from sub-categories (beneath the specified one). If you only want products from the selected category change the while loop for the products with an if. Something like: if($products = tep_db_fetch_array($products_query)) {
jeffy777 Posted September 20, 2005 Author Posted September 20, 2005 Yes, I would like for it to display products from the specified category and products from sub-categories. The problem is it still displays products from every category, regardless of the one I specify in the var.
Guest Posted September 20, 2005 Posted September 20, 2005 can you PM me the modified file? I'll take a look. Kinda long to post it here
Kjolebutikken Posted February 11, 2006 Posted February 11, 2006 can you PM me the modified file? I'll take a look. Kinda long to post it here Hi, if you ever made this work, I would be very happy if you could give me the solution. I also would like this in my all products page. Thank you:-) Kjolebutikken Best regards Kjolebutikken
Recommended Posts
Archived
This topic is now archived and is closed to further replies.