Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

advance search engine question


Guest

Recommended Posts

Posted

hi eberybody..

 

i want to know witch code in witch file i have to change to be able to made a search with out entering a data.

 

right now on a stock OSC if you click search it will return

 

 

enter at least 1 field.. bla bla bla...

 

but i want to be able to search leaving this as is.

 

so please what's the answer??

 

yours

 

sebastien

Posted
Are you saying you want to search for nothing?

 

Jack

 

 

No... look in your advance search engine. you will see by defaul ALL categories and ALL manufacturer or selected.

 

so when you clic on search you receive the error message..

 

but i want the result of this search

 

base on this information i have other development to do. but first i have to solve this thing.

 

thank's and if you can help me it will be appreciate

 

yours

 

sebastien

Posted

You want the search to return all product for selected category?

 

Removing error wont help, you'll still get nothing, this should do what you want

 

in advanced_search.php

 

find

 

  $info_box_contents[] = array('text' => tep_draw_input_field('keywords', '', 'style="width: 100%"'));

 

replace with

 

  $info_box_contents[] = array('text' => tep_draw_input_field('keywords', '%', 'style="width: 100%"'));

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 want the search to return all product for selected category?

 

Removing error wont help, you'll still get nothing, this should do what you want

 

in advanced_search.php

 

find

 

  $info_box_contents[] = array('text' => tep_draw_input_field('keywords', '', 'style="width: 100%"'));

 

replace with

 

  $info_box_contents[] = array('text' => tep_draw_input_field('keywords', '%', 'style="width: 100%"'));

 

 

thnk's sam just try it.. it works BUT i know the kind of customer they will came on the site and they can remove the % in the search critera and then click search. result: got the error message

 

 

i'll try to find a way to hide this caractere

 

yours

 

sebastien

 

PS: if someone found something please let me know

Posted

the other things is if you leave the kewyord section empty and choose a categorie only it will return the same erro message

 

WHY??

 

yours

sebastien

Posted

A category search for nothing will return nothing, so % still required.

 

NB If you have an early version of Security Pro it will remove the %, if you don`t have Security Pro ADD IT NOW!!!

 

If you don't want the % in the input field, modify the error code so if no input it inserts the % and passes.

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

thank's spooks will try this..

 

but in fact i'm looking for something when i don't enter a keyword. look the default advance search is lloking to ALL categories and ALL manufacturer. so by defaulr if i click on search it should be retrun everything in stcok.... no??

 

what do you think??

 

also the other problem i found is if i select only a categorie it return the same message but will do the search if i select a munafacturer only... strange???

 

so i try this security pro and let you know

 

yours

 

sebastien

Posted

By your logic if you enter nothing into google it should give you every web page in the world as a result!!!

 

 

DERRRRR

 

 

If you want that, do what I said, bouncing back silly ideas ain`t going to change it.

 

:rolleyes: :rolleyes: :rolleyes:

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
By your logic if you enter nothing into google it should give you every web page in the world as a result!!!

 

 

DERRRRR

 

 

If you want that, do what I said, bouncing back silly ideas ain`t going to change it.

 

:rolleyes: :rolleyes: :rolleyes:

 

NO i never say that.

 

 

i think you don't understand what i do.. go see by yourself your advance search. by default ALL categories and ALL manufacturer are selected. so .. normaly if i hit the search button it should return the containt of ALL categories and ALL manufacturer. right... but with the stock OSC it will not do that.

 

 

now try this. select only a categorie and hit the search button. please tell me what you have in answer??

 

yours

 

sebastien

Posted

PROBLEM PROBLEM now nothing run like i want after i instal the security pro contribution.

 

first: the % character still in the keyword space.

second: when i hit the search bar error message return... error at leat one .......

third: now i'm unable to put the scale of my thing like 1/24 because now it doesn't support the / as a caracter.

 

 

SPOOKS or anybodyelse HELP ME what's wrong.. if you need any code let me know i will post them

 

yours

 

sebastien

Posted

/ is a proble character, hence its removal to sanitise.

 

To allow:

 

In includes/functions/security.php

 

find:

 

 

return preg_replace("/[^ {}a-zA-Z0-9_.-]/i", "", urldecode($get_var));

 

replace with:

 

 

return preg_replace("/[^ \/{}a-zA-Z0-9%_.-]/i", "", urldecode($get_var));

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

thank you now it accept my / but the % still visible???

 

is theyre an other file i have to edit??

 

yours

 

sebastien

Posted
thank you now it accept my / but the % still visible???

 

is theyre an other file i have to edit??

 

yours

 

sebastien

Hi

 

From reading the original post, does the OP want to display all products when the keyword is blank?? If so this thread does that and I have it working on my site

 

Cheers

 

Ian

Posted
Hi

 

From reading the original post, does the OP want to display all products when the keyword is blank?? If so this thread does that and I have it working on my site

 

Cheers

 

Ian

 

 

that was working. but now i added a contibution... product extra filed and now i receiving this message

 

Warning: Invalid argument supplied for foreach() in C:\wamp\www\catalog\advanced_search_result.php on line 309

 

this is what i have from line 308 to 333

 

// START: Extra Fields Contribution Search Fields 1.0
foreach ($pef_values as $pef_id => $pef_value)
{
 tep_parse_search_string($pef_value, $pef_value_keywords);
 if (isset($pef_value_keywords) && (sizeof($pef_value_keywords) > 0)) {
$where_str .= " and (";
for ($i=0, $n=sizeof($pef_value_keywords); $i<$n; $i++ ) {
  switch ($pef_value_keywords[$i]) {
	case '(':
	case ')':
	case 'and':
	case 'or':
	  $where_str .= " " . $pef_value_keywords[$i] . " ";
	  break;
	default:
	  $keyword = tep_db_prepare_input($pef_value_keywords[$i]);
	  $where_str .= "(p2pef.products_extra_fields_value like '%" . tep_db_input($keyword) . "%'";
	  $where_str .= " AND p2pef.products_extra_fields_id = ". (int)$pef_id;
	  $where_str .= ')';
	  break;
  }
}
$where_str .= " )";
 }
}
// END: Extra Fields Contribution

Posted

ok now it' working i remove one } and it fo what is supposed to do

 

thank's to all who hel me with this one

 

yours

 

sebastien

Archived

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

×
×
  • Create New...