Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Searching without keyword = no results


phynesse

Recommended Posts

I ve looked all over for this, but only found two unanswered posts:

 

if I do not enter a keyword, advanced search will give me an error. ("enter at least one..." blabla)

 

Can anyone tell me what i need to do, so that an empty textbox will return all products (minus possibly category/date etc. restrictions set below)?? i just want customers to be able to search a certain manufacturer in a certain category and have them all listed.

 

it works if i enter a single [space] as a keyword. so i ve tried to have that entered by default, but it still produces that error.

 

any help greatly appreciated!

-Bass

 

take a look? test.cigarlabelart.com/catalog [under construction]

Link to comment
Share on other sites

I think I found it! (I rule! lol) B)

 

Open /catalog/advanced_search_results.php

 

NOTE: TRY AT YOUR OWN RISK!!!!!!!!!!

 

Delete the following lines (or add // before each line)

(~line 119-127)

--------------

 

if (empty($dfrom) && empty($dto) && empty($pfrom) && empty($pto) && empty($keywords)) {

$error = true;

 

$messageStack->add_session('search', ERROR_AT_LEAST_ONE_INPUT);

}

 

if ($error == true) {

tep_redirect(tep_href_link(FILENAME_ADVANCED_SEARCH, tep_get_all_get_params(), 'NONSSL', true, false));

}

 

---------------

 

INTENDED EFFECT:

When entering no keyword in searches, it will now list ALL products, instead of prompting an error. Filtering by category, price range etc. still works, of course.

 

Hope it works for others as well!

 

Have a nice day,

BASS

Link to comment
Share on other sites

  • 1 year later...
I think I found it! (I rule! lol) B)

 

Open /catalog/advanced_search_results.php

 

NOTE: TRY AT YOUR OWN RISK!!!!!!!!!!

 

Delete the following lines (or add // before each line)

(~line 119-127)

--------------

 

if (empty($dfrom) && empty($dto) && empty($pfrom) && empty($pto) && empty($keywords)) {

$error = true;

 

$messageStack->add_session('search', ERROR_AT_LEAST_ONE_INPUT);

}

 

if ($error == true) {

tep_redirect(tep_href_link(FILENAME_ADVANCED_SEARCH, tep_get_all_get_params(), 'NONSSL', true, false));

}

 

---------------

 

INTENDED EFFECT:

When entering no keyword in searches, it will now list ALL products, instead of prompting an error. Filtering by category, price range etc. still works, of course.

 

Hope it works for others as well!

 

Have a nice day,

BASS

This doesn't work for me, is there any other way to not force entry of keywords?

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...