Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Option to remove pagination of search results


Guest

Recommended Posts

Posted

I need to have an option on my /catalog/advanced_search_result.php page so that users can click a "View All" link at the top of the first page of results, and this then shows every siongle result on a single page rather than paginating the search results. Does anyone know how this can be done?

Posted

I need to have an option on my /catalog/advanced_search_result.php page so that users can click a "View All" link at the top of the first page of results, and this then shows every single result on a single page rather than paginating the search results. Does anyone know how this can be done?

 

I guess this isn't possible then??!

Posted

Everything is possible.

 

You need to have your "view all" link amend the SQL that outputs the list of items.

 

This most likely exists either in the form of a contribution or in the forum somewhere. I would find it hard to believe that no-one has asked for this before in the last 10 years.

Posted

It is. The edits to make would be in the /includes/modules/product_listing.php file. It would affect any product listing page whether as a result of a search or other option.

 

You would have add a link for Show All that would have to re-run the script with a variable when set that ignores the $listing_split functions on a conditional.

 

Not too difficult, but returns don't outweigh the costs to code it, IMHO. But that gives you a place to start tinkering around. Good luck.

Community Bootstrap Edition, Edge

 

Avoid the most asked question. See How to Secure My Site and How do I...?

Posted

It is. The edits to make would be in the /includes/modules/product_listing.php file. It would affect any product listing page whether as a result of a search or other option.

 

You would have add a link for Show All that would have to re-run the script with a variable when set that ignores the $listing_split functions on a conditional.

 

Not too difficult, but returns don't outweigh the costs to code it, IMHO. But that gives you a place to start tinkering around. Good luck.

 

Thanks, I will see what I can do... :)

Posted

Thanks, I will see what I can do... :)

 

Okay, well I can't see where in /includes/modules/product_listing.php I would make these edits unfortunately, or how I can make the script re-run itself. However the client insists that they "need" this feature so I need to find a way somehow...

Posted

Okay, well I can't see where in /includes/modules/product_listing.php I would make these edits unfortunately, or how I can make the script re-run itself. However the client insists that they "need" this feature so I need to find a way somehow...

 

 

If you look at Product Listing Enhancements, Thumbnails & Manufacturer Headings http://addons.oscommerce.com/info/6051 you will see it has a drop down for results per page that has a 'show all' option.

 

If you are a developer you should have no trouble extracting that bit of code for your clients site. smile.gif

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Posted

You reload the page without the LIMIT clause on the listing_split...

 

Does your client have a budget? If so, spend it on getting it coded, then upload it to the contributions area for everyone to use in the future.

Posted

If you look at Product Listing Enhancements, Thumbnails & Manufacturer Headings http://addons.oscommerce.com/info/6051 you will see it has a drop down for results per page that has a 'show all' option.

 

If you are a developer you should have no trouble extracting that bit of code for your clients site. smile.gif

 

Ok, the only thing is, rather than the product listing page, I actually need this functionality in the advanced_search_result.php page (because this potentially generates many hundreds of results, so we need an option to remove the pagination if a user wants to quickly browse all). I've downloaded and unzipped the mod but don't see any edited version of advanced_search_result.php, is there a way to edit this page to get the required functionality added?

 

I also had a look through the modded modules/product_listing.php page and found this section:

 

// Max Results Array		
for ($i=1; $i<10; $i++) {		
	$max_display[] = array('id' => $max_rows * $i, 'text' => $max_rows * $i); 
	}	
	$max_display[] = array('id' => 1000000, 'text' => 'Show All');

 

Presumably this is the right area to add. Although I'm not sure if anything else needs to be added to my own product_listing.php?

 

Thanks

Posted

Ok, the only thing is, rather than the product listing page, I actually need this functionality in the advanced_search_result.php page (because this potentially generates many hundreds of results, so we need an option to remove the pagination if a user wants to quickly browse all). I've downloaded and unzipped the mod but don't see any edited version of advanced_search_result.php, is there a way to edit this page to get the required functionality added?

 

I also had a look through the modded modules/product_listing.php page and found this section:

 

// Max Results Array		for ($i=1; $i<10; $i++) {				$max_display[] = array('id' => $max_rows * $i, 'text' => $max_rows * $i); 		}			$max_display[] = array('id' => 1000000, 'text' => 'Show All');

 

Presumably this is the right area to add. Although I'm not sure if anything else needs to be added to my own product_listing.php?

 

Thanks

 

The file works with advanced_search_result.php because advanced_search_result.php calls product_listing.php for output, if you wish to limit for search results only, do a test for the calling page.

 

Thats bit generats the array thats used in the drop, see tips forum for my thread on creating a drop, don't forget to process the results though. wink.gif

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

  • 2 weeks later...
Posted

You reload the page without the LIMIT clause on the listing_split...

 

Does your client have a budget? If so, spend it on getting it coded, then upload it to the contributions area for everyone to use in the future.

 

I tried looking for LIMIT in product_listing.php but my version of the file doesn't have it at all?

 

I still can't figure which bit of product_listing.php I have to edit- can anyone let me know? And let me know exactly what I need to do- I don't need the extra enhancements that come with the mod, I just need a simple View All link. I'm surprised OSC doesn't come with the feature pre-packaged?

Posted

I tried looking for LIMIT in product_listing.php but my version of the file doesn't have it at all?

 

I still can't figure which bit of product_listing.php I have to edit- can anyone let me know? And let me know exactly what I need to do- I don't need the extra enhancements that come with the mod, I just need a simple View All link. I'm surprised OSC doesn't come with the feature pre-packaged?

 

 

look at the split place results class & how it handles params

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Posted

look at the split place results class & how it handles params

 

Okay... I've spent ages looking through product_listing.php and I can see half a dozen areas where it references splitting the search results, for example:

 

   <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>

 

But which of these areas need to be changed and how do I go about changing them? I don't want to stop the pagination but I just want the option for View All to be there- there isn't anything in the file I can see that indicates how I should do this?

 

Thanks

Posted

    <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>

 

 

 

wrong area

 

 

 

$listing_split = new splitPageResults($listing_sql, $max_results, 'p.products_id');

 

I think that line is self exlanitory!!

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Posted

wrong area

 

 

 

$listing_split = new splitPageResults($listing_sql, $max_results, 'p.products_id');

 

I think that line is self exlanitory!!

 

Yeah- I can see that this is for dividing the results into their respective pages.

 

So I guess I need a different version of product_listing.php (maybe called product_listing_all.php) which has this commented out, so the products all display on a single page?

Posted

Just set $max_results to a really high number ;)

 

problem is I still want the search results to be paginated by default, won't setting maxresults high mean the products default to a single long listing?

 

I had a look for the string in my product_listing.php but this is the closest I could find, near the top of the file:

 

$listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id');

Posted

Just enclose it in an "if" based on the "view all" link that you'll create.

 

Also, google is your friend. This has been covered in the past.

Posted

Just enclose it in an "if" based on the "view all" link that you'll create.

 

Also, google is your friend. This has been covered in the past.

 

So you mean:

 

if (something?){
 $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id');
}

 

What would the "something" be though? I'm not following what should go where with this. Do you mean enclose the $listing_split... in the if? In which case what needs to be outside it, after all it has to be "if" something...

 

Sorry to be longwinded but I'm just looking for a bit of detail. Thanks.

Posted

 

 

 

try researching & learning more php, you'll get on much faster!!

 

set a query param in your link, then test that param to tell what to set $max_results to.

 

PHP Tuition http://us.php.net/tut.php

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Posted

try researching & learning more php, you'll get on much faster!!

 

set a query param in your link, then test that param to tell what to set $max_results to.

 

PHP Tuition http://us.php.net/tut.php

 

Ok, well I wish I had time to read more, unfortunately I need to get these issues sorted... someone mentioned making the View All link in advanced_search_result.php reload that page but without the listing pagination. Can someone at least explain how that's done so I can have a go at that? At the moment all I have is a few one-liners to go on so it's impossible to kmnow where to start...

Posted

You definitely have all the information that you require, now you need to put the jigsaw together and make it work.

 

1. make a view all link

2. pass a parameter thru that link

3. set $max_results based on the parameter

 

You can not and must not rely on ever getting help from this forum. If a certain handful of people left this forum today, there would be zero help given tomorrow.

Posted

You definitely have all the information that you require, now you need to put the jigsaw together and make it work.

 

1. make a view all link

2. pass a parameter thru that link

3. set $max_results based on the parameter

 

You can not and must not rely on ever getting help from this forum. If a certain handful of people left this forum today, there would be zero help given tomorrow.

 

Yeah- fair enough. I reckon I've wasted enough people's time with the problem, and I guess I'm just not good at explaining the problem either! - so I can't really expect to get the answers I need (even now, I'm not clear what (2) (pass a parameter thru that link) actually entails- what parameter? How do I pass it thru?). Guess I'll try and find out on Google. Apologies for this thread going on so long. Thanks, bye...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...