Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Site Search Plus


Jack_mcs

Recommended Posts

Hello Jack,

 

I found that when customers did a search by color they had this error:

 

1104 - The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay

 

select count(distinct p.products_id) as total from products p left join manufacturers m using(manufacturers_id) left join specials s on p.products_id = s.products_id left join products_attributes pa on p.products_id = pa.products_id left join products_options_values pov on pa.options_values_id = pov.products_options_values_id , products_description pd, categories c, products_to_categories p2c where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and ((((pd.products_name like '%débardeur%' or p.products_model like '%débardeur%' or m.manufacturers_name like '%débardeur%' )) or ( pov.products_options_values_name like '%débardeur%' )) )

 

[TEP STOP]

 

How do I correct that?

 

Mandy

Link to comment
Share on other sites

Try this. In the advanced_search_result.php file, find this line

require(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING); 

and add this right before it

tep_db_query("set sql_big_selects=1"); 

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Try this. In the advanced_search_result.php file, find this line

require(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING); 

and add this right before it

tep_db_query("set sql_big_selects=1"); 

 

 

 

BINGO! That works! Thank you Jack and have a good dy!

 

Mandy

Link to comment
Share on other sites

  • 2 weeks later...

Hi

Thanks for this contribution as been looking for something nice and easy to have on the site.

 

I have one small problem though, when I copy all the files to my site the search function works great but all my store prices are showing as "0". I removed the files and replaced them with my backups and my prices are back to normal.

 

Any ideas why this would happen as would really like to use this function.

 

Thanks

 

Hammer

 

my prices are in Euros if that makes a difference

 

oops never mind just found the line i forgot to amend

Edited by Hammer100
Link to comment
Share on other sites

I use the contribution articles manager 1v4, I installed site search plus v1_2_c, worked fine local but after uploading the files on my server the script didn't search any articles only pages and displayed my sites files....

 

I applied te modif suggested:

 

//CheckAllPages($dir, $searchTerm, $fileList, $articlesList, $pagesList, $languages_id);

 

but now it's only searching and displaying results found in products...

 

What do i have to do for the script to search only products AND articles (no pages)?

 

How can it works local and not live, I checked many times and I sure I didn't miss a file, I have no error at all...

 

Thanks

 

Theo

Link to comment
Share on other sites

In includes/functions/site_search.php, find this line

$fileList = CheckFileContents($dir, $searchTerm, $fileList, $languageDir);

and change it to

//$fileList = CheckFileContents($dir, $searchTerm, $fileList, $languageDir);

Edited by Jack_mcs

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

with your modif the function CheckAllPages won't work because it's calling "&$fileList"

 

so, what should I have exactly here? what should be commented off in order to search products+articles and not display every single page on my server?

***

 

function CheckAllPages($dir, $searchTerm, &$fileList, &$articlesList, &$pagesList, $languages_id)

{

$languageDir = GetLanguageDirectory($languages_id); //need the name of the directory to search

$fileList = CheckFileContents($dir, $searchTerm, $fileList, $languageDir);

$pagesList = CheckInfomationPages($searchTerm, $pagesList, $languages_id);

$articlesList = CheckArticles($searchTerm, $languages_id);

***

Thanks

 

Theo

Link to comment
Share on other sites

I am just asking if I also need to comment (as you previously indicated):

 

//CheckAllPages($dir, $searchTerm, $fileList, $articlesList, $pagesList, $languages_id);

 

OR should I have it like it was:

 

CheckAllPages($dir, $searchTerm, $fileList, $articlesList, $pagesList, $languages_id);

 

and what should the code below looks like.... as if I have this line

 

//$fileList = CheckFileContents($dir, $searchTerm, $fileList, $languageDir);

 

the function CheckAllPages won't work...

 

***

function CheckAllPages($dir, $searchTerm, &$fileList, &$articlesList, &$pagesList, $languages_id)

{

$languageDir = GetLanguageDirectory($languages_id); //need the name of the directory to search

$fileList = CheckFileContents($dir, $searchTerm, $fileList, $languageDir);

$pagesList = CheckInfomationPages($searchTerm, $pagesList, $languages_id);

$articlesList = CheckArticles($searchTerm, $languages_id);

 

***

 

Thanks

 

Theo

Link to comment
Share on other sites

That's what I did, i have:

 

****

 

function CheckAllPages($dir, $searchTerm, &$fileList, &$articlesList, &$pagesList, $languages_id)

{

$languageDir = GetLanguageDirectory($languages_id); //need the name of the directory to search

//$fileList = CheckFileContents($dir, $searchTerm, $fileList, $languageDir);

$pagesList = CheckInfomationPages($searchTerm, $pagesList, $languages_id);

$articlesList = CheckArticles($searchTerm, $languages_id);

}

 

*** but the result is only from product listing which is weird as local on my computer it's working fine...

 

Theo

Link to comment
Share on other sites

I found out what was wrong... At first I installed (local) the last version of Articles Manager and didn't notice that Header Tags SEO were mandatory so I went back to Articles Manager 1.4 and in this version, the code below is not in the SQL query :

 

INSERT INTO `configuration_group` ( `configuration_group_id` , `configuration_group_title` , `configuration_group_description` , `sort_order` , `visible` )

VALUES ('456', 'Articles Manager', 'Articles Manager site wide options', '20' , '1');

 

On the live site I directly installed the V1.4 without this configuration_group reason why the script was not searching through articles and as I had it local from the previous install it was working fine on my computer...

 

I added the missing query on my live site and now it's working fine.

 

Thanks

 

Theo

Link to comment
Share on other sites

Mandatory email?

 

I have uploaded your advanced_search_result.php (coming with the script) but it doesn't make mandatory for the customer to write his email when requesting information/products.

 

In fact the form can be send totally empty.

 

What did I do wrong on this one?

 

Also for example, if someone search "test" it brings back every single article containing "test" in a word, e.g. "intestinal", is there a way to get the exact result and is it possible to enlight searched text in search results.?

 

 

Thanks

 

Theo

Link to comment
Share on other sites

Mandatory email?

 

I have uploaded your advanced_search_result.php (coming with the script) but it doesn't make mandatory for the customer to write his email when requesting information/products.

 

In fact the form can be send totally empty.

There's code to check that. Yo might want to go back through the installation instructions or try the included files.

 

Also for example, if someone search "test" it brings back every single article containing "test" in a word, e.g. "intestinal", is there a way to get the exact result and is it possible to enlight searched text in search results.?

That's how the search code works, with or without this contribution. The code in advanced search result could be changed to just include exact matches but it isn't an option currently.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

ok but do I have to to to make the email mandatory? As I explained, I use the original advanced_search_result.php coming with your contribution

 

Also, when someone fill the form, I'd like him to be redirected to the login page instead of the index, what should I modify?

 

Thanks

 

Theo

Link to comment
Share on other sites

yes but the product_listing doesn't check if the customer send an empty form...

 

the verification is obviously the code below in advanced_search_result.php and it doesn't check anything:

 

function validateEmail(fld) {

var error="";

var tfld = trim(fld.value); // value of field with whitespace trimmed off

var emailFilter = /^[^@]+@[^@.]+\.[^@]*\w\w$/ ;

var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/ ;

 

if (fld.value == "") {

fld.style.background = 'Yellow';

error = "Please enter an email address.\n";

} else if (!emailFilter.test(tfld)) { //test email for illegal characters

fld.style.background = 'Yellow';

error = "Please enter a valid email address.\n";

} else if (fld.value.match(illegalChars)) {

fld.style.background = 'Yellow';

error = "The email address contains illegal characters.\n";

} else {

fld.style.background = 'White';

}

return error;

}

Edited by doctorTheo
Link to comment
Share on other sites

I don't know, i saw under this topic others had the same problem but I didn't find an answer....

 

I have no problem with the contact_us.php which works almost same way and check that the form is filled correctly so it can't be some browser setting...

Link to comment
Share on other sites

  • 4 months later...

Hi Jack,

 

Thanks for pointing me to this add-on. Just a question before I start though. I have the Simple Search Box (http://addons.oscommerce.com/info/3329) add-on installed into my header and it reroutes the search.php via search2.php, do you know if this will cause problems trying to install your add-on?

 

Thanks.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...