MANDY1 Posted October 18, 2009 Share Posted October 18, 2009 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 Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted October 18, 2009 Author Share Posted October 18, 2009 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"); Quote 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 More sharing options...
MANDY1 Posted October 18, 2009 Share Posted October 18, 2009 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 Quote Link to comment Share on other sites More sharing options...
Hammer100 Posted October 30, 2009 Share Posted October 30, 2009 (edited) 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 October 30, 2009 by Hammer100 Quote Link to comment Share on other sites More sharing options...
doctorTheo Posted November 3, 2009 Share Posted November 3, 2009 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 Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted November 3, 2009 Author Share Posted November 3, 2009 (edited) 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 November 3, 2009 by Jack_mcs Quote 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 More sharing options...
doctorTheo Posted November 4, 2009 Share Posted November 4, 2009 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 Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted November 4, 2009 Author Share Posted November 4, 2009 That change works fine when I try it here. What error are you getting? Quote 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 More sharing options...
doctorTheo Posted November 4, 2009 Share Posted November 4, 2009 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 Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted November 4, 2009 Author Share Posted November 4, 2009 Oh, so you haven't tried it. When you do, if it fails, please post the error here. Quote 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 More sharing options...
doctorTheo Posted November 4, 2009 Share Posted November 4, 2009 I tried your modif, I don't get any error but it searches only in products, not in articles. Theo Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted November 4, 2009 Author Share Posted November 4, 2009 Be sure to remove the //CheckAllPages change you said you have made previously. Quote 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 More sharing options...
doctorTheo Posted November 4, 2009 Share Posted November 4, 2009 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 Quote Link to comment Share on other sites More sharing options...
doctorTheo Posted November 4, 2009 Share Posted November 4, 2009 In fact, it's no longer working in local, i get this error: Warning: Missing argument 6 for checkallpages() \includes\functions\site_search.php on line 52 I don't have this error on the live site Theo Quote Link to comment Share on other sites More sharing options...
doctorTheo Posted November 4, 2009 Share Posted November 4, 2009 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 Quote Link to comment Share on other sites More sharing options...
doctorTheo Posted November 4, 2009 Share Posted November 4, 2009 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 Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted November 5, 2009 Author Share Posted November 5, 2009 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. Quote 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 More sharing options...
doctorTheo Posted November 5, 2009 Share Posted November 5, 2009 Hi Jack I did apply all the install instructions and I am using the INCLUDED advanced_search_result.php ... look to me this is where the code is to check email. Is it possible to highlight search result? Thanks Theo Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted November 5, 2009 Author Share Posted November 5, 2009 Not with the code as it is now. Quote 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 More sharing options...
doctorTheo Posted November 5, 2009 Share Posted November 5, 2009 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 Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted November 5, 2009 Author Share Posted November 5, 2009 The form is in the product_listing.php file. Quote 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 More sharing options...
doctorTheo Posted November 5, 2009 Share Posted November 5, 2009 (edited) 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 November 5, 2009 by doctorTheo Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted November 5, 2009 Author Share Posted November 5, 2009 It works as expected when I try it. Perhaps it is some server or browser setting? Quote 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 More sharing options...
doctorTheo Posted November 5, 2009 Share Posted November 5, 2009 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... Quote Link to comment Share on other sites More sharing options...
Whiskers Posted March 9, 2010 Share Posted March 9, 2010 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.