netinsco Posted February 5, 2009 Posted February 5, 2009 Hi, Does anybody know how I can limit the number of pages that each category displays. For example, I have over 100 products in a given category but I only want to display 40 of them at any given time. I'm displaying 8 items per page and would like to only display 40 items total in any given category or six pages. I tried to limit the SQL statement to the top 40 but that didn't work. Then, I thought there would be a way to set the number of pages a category can display. Does anybody have a suggestion how I can make this work? Thank you, Mike
Guest Posted February 5, 2009 Posted February 5, 2009 Go to your Admin-->Configuration-->Maximum Values. Try setting Search Results to what you want.
netinsco Posted February 5, 2009 Author Posted February 5, 2009 Go to your Admin-->Configuration-->Maximum Values. Try setting Search Results to what you want. Hi bktrain, I've worked with that product to display the number of products per page. Search Results: Number of products listed on the store product pages per page. I'm trying to set the maximum number of pages per category. Any Ideas? Mike
netinsco Posted February 7, 2009 Author Posted February 7, 2009 Hi bktrain, I've worked with that product to display the number of products per page. Search Results: Number of products listed on the store product pages per page. I'm trying to set the maximum number of pages per category. Any Ideas? Mike Maybe it is not so easy to limit the number of pages per category. Would it be easier setting the Limit in the SQL statement so only 40 products are show per category? Mike
netinsco Posted February 10, 2009 Author Posted February 10, 2009 Go to your Admin-->Configuration-->Maximum Values. Try setting Search Results to what you want. Has anyonve ever worked with the split_page-results.php in the classes folder to only display a fixed number of pages per category?
netinsco Posted February 10, 2009 Author Posted February 10, 2009 Hi, Does anybody know how I can limit the number of pages that each category displays. For example, I have over 100 products in a given category but I only want to display 40 of them at any given time. I'm displaying 8 items per page and would like to only display 40 items total in any given category or six pages. I tried to limit the SQL statement to the top 40 but that didn't work. Then, I thought there would be a way to set the number of pages a category can display. Does anybody have a suggestion how I can make this work? Thank you, Mike Okay Okay, I'm getting somewhere and I wanted to share it with the forum for later reference if someone want to do what I'm trying. I have found I can hard code the number of rows I can get for any query in the splitPageResults Class which is in the split_page_results.php. So, I can now show a fixed number of products for ALL categories. for example 40 in every category or 5 pages. $count_query = tep_db_query("select count(" . $count_string . ") as total " . substr($this->sql_query, $pos_from, ($pos_to - $pos_from))); $count = tep_db_fetch_array($count_query); //$this->number_of_rows = $count['total']; //I COMMENTED THIS LINE OUT THEN $this->number_of_rows = 40; //ADDED THIS LINE Since I have Maximum Search results set at 8 and set the select count to 40 I display 5 pages in all categories. Now all I need is to figure out how I can pass the category ID into the splitpageResuts class and function so I can control the number of rows I display in each category. Does anybody have an idea how I can pass the $cPath variable into the class and function?
netinsco Posted February 14, 2009 Author Posted February 14, 2009 Hi, Does anybody know how I can limit the number of pages that each category displays. For example, I have over 100 products in a given category but I only want to display 40 of them at any given time. I'm displaying 8 items per page and would like to only display 40 items total in any given category or six pages. I tried to limit the SQL statement to the top 40 but that didn't work. Then, I thought there would be a way to set the number of pages a category can display. Does anybody have a suggestion how I can make this work? Thank you, Mike OKAY, I made it work and thought I'd share with you what I did. I took the appoach to manage the number of pages per category. So in split_page_results.php I brought in a global variable $current_category_id on line 18. function splitPageResults($query, $max_rows, $count_key = '*', $page_holder = 'page') { global $HTTP_GET_VARS, $HTTP_POST_VARS, $current_category_id; Then I added a switch/case statement to set the number of items in the same file. switch ($current_category_id) { case 21: //HANDBAGS $this->number_of_rows = 40; break; case 22: //WALLETS $this->number_of_rows = 16; break; case 31: //EARRINGS $this->number_of_rows = 24; break; case 34: //NECKLACES $this->number_of_rows = 32; break; case 32: //BRACELETS $this->number_of_rows = 8; break; case 24: //SHAWLS $this->number_of_rows = 32; break; case 25: //SCARVES $this->number_of_rows = 32; break; default: $this->number_of_rows = $count['total']; break; }
Recommended Posts
Archived
This topic is now archived and is closed to further replies.