kru Posted November 16, 2006 Share Posted November 16, 2006 (edited) We implemented the 'searchbox searchin in descriptions' contribution that hhaller and simmerl worked on in 2004 and we like it. It's a pretty quick way to allow searches in the product_description right from the Quick Find box. Here's the link if anyone wants to look at it: http://www.oscommerce.com/community/contri...advanced+search Check out the description for the second version from the bottom if you need it in english. The only problem we're having is that it does not allow us to do exact string searches. Does anyone know how to remedy this? We sell vehicle-specific products, so we would like to be able to put a tip in the search box that quotes will help refine a search (ie- "2000 Ford Explorer") since we enter the applications with year, make and model in the product descriptions. If customers could search in that manner, they wouldn't get the results that happen to have all those keywords in different places in the listing but don't really apply for their vehicle. Thanks for your help. Edited November 16, 2006 by kru Quote Add-Ons personally installed:Step by Step Manual Order -- Request Reviews -- Reviews in Product Listing -- Reviews in Product Display -- Review Approval System -- Leverage Browser Cache --Header Tag Controller -- Multilayer SEO Pop Out Menu -- Follow Us Box -- View All Products -- USPS Shipping Labels -- UPS Shipping Labels -- Monthly Sales/Tax Report --htacess Optimisation -- Remove Unused Images -- Master Password -- Admin Change Customer Password -- Database Backup Manager -- Zero Stock Report --Searchbox Search In Descriptions -- Easy Populate 2.76i -- Barcode Rendering -- Admin Sort By Model -- Products Purchased ReportAdd-Ons personally developed:Search for email address, etc in Orders -- Discontinue ProductAdd-Ons installed by others:View Counter -- Site Monitor -- Image Thumbnailer -- Database Optimizer -- Recaptcha -- Discount Coupons -- Add More Fields Link to comment Share on other sites More sharing options...
Guest Posted November 16, 2006 Share Posted November 16, 2006 You need to have a query that uses regexp if the quotes are present in the search string... lots about it on Google :) Sonia Quote Link to comment Share on other sites More sharing options...
kru Posted November 25, 2006 Author Share Posted November 25, 2006 You need to have a query that uses regexp if the quotes are present in the search string... lots about it on Google :)Sonia Well, I was hoping to find someone who has already done it using osCommerce and is willing to provide their input/guidance. Or find out if there was already a contrib for this (although I searched and didn't see anything.) I'm not looking to recreate 'the wheel' and, even if this 'wheel' hasn't been created, I doubt I'm the right one to create it... :) Quote Add-Ons personally installed:Step by Step Manual Order -- Request Reviews -- Reviews in Product Listing -- Reviews in Product Display -- Review Approval System -- Leverage Browser Cache --Header Tag Controller -- Multilayer SEO Pop Out Menu -- Follow Us Box -- View All Products -- USPS Shipping Labels -- UPS Shipping Labels -- Monthly Sales/Tax Report --htacess Optimisation -- Remove Unused Images -- Master Password -- Admin Change Customer Password -- Database Backup Manager -- Zero Stock Report --Searchbox Search In Descriptions -- Easy Populate 2.76i -- Barcode Rendering -- Admin Sort By Model -- Products Purchased ReportAdd-Ons personally developed:Search for email address, etc in Orders -- Discontinue ProductAdd-Ons installed by others:View Counter -- Site Monitor -- Image Thumbnailer -- Database Optimizer -- Recaptcha -- Discount Coupons -- Add More Fields Link to comment Share on other sites More sharing options...
kru Posted December 24, 2011 Author Share Posted December 24, 2011 We never got anything to work for this exact string search. We would like customers to be able to search for "2009 Ford Explorer", for instance, and not get results just because the description has all three words scattered about. We only want results that have those three words strung together. Can anyone provide any insight? We tried the regexp suggestion but it did not work. Quote Add-Ons personally installed:Step by Step Manual Order -- Request Reviews -- Reviews in Product Listing -- Reviews in Product Display -- Review Approval System -- Leverage Browser Cache --Header Tag Controller -- Multilayer SEO Pop Out Menu -- Follow Us Box -- View All Products -- USPS Shipping Labels -- UPS Shipping Labels -- Monthly Sales/Tax Report --htacess Optimisation -- Remove Unused Images -- Master Password -- Admin Change Customer Password -- Database Backup Manager -- Zero Stock Report --Searchbox Search In Descriptions -- Easy Populate 2.76i -- Barcode Rendering -- Admin Sort By Model -- Products Purchased ReportAdd-Ons personally developed:Search for email address, etc in Orders -- Discontinue ProductAdd-Ons installed by others:View Counter -- Site Monitor -- Image Thumbnailer -- Database Optimizer -- Recaptcha -- Discount Coupons -- Add More Fields Link to comment Share on other sites More sharing options...
kru Posted December 28, 2011 Author Share Posted December 28, 2011 Anyone? Quote Add-Ons personally installed:Step by Step Manual Order -- Request Reviews -- Reviews in Product Listing -- Reviews in Product Display -- Review Approval System -- Leverage Browser Cache --Header Tag Controller -- Multilayer SEO Pop Out Menu -- Follow Us Box -- View All Products -- USPS Shipping Labels -- UPS Shipping Labels -- Monthly Sales/Tax Report --htacess Optimisation -- Remove Unused Images -- Master Password -- Admin Change Customer Password -- Database Backup Manager -- Zero Stock Report --Searchbox Search In Descriptions -- Easy Populate 2.76i -- Barcode Rendering -- Admin Sort By Model -- Products Purchased ReportAdd-Ons personally developed:Search for email address, etc in Orders -- Discontinue ProductAdd-Ons installed by others:View Counter -- Site Monitor -- Image Thumbnailer -- Database Optimizer -- Recaptcha -- Discount Coupons -- Add More Fields Link to comment Share on other sites More sharing options...
♥bruyndoncx Posted December 30, 2011 Share Posted December 30, 2011 the logic is in general.php tep_parse_search_string function thisis the start of the function //// // Parse search string into indivual objects function tep_parse_search_string($search_str = '', &$objects) { $search_str = trim(strtolower($search_str)); // Break up $search_str on whitespace; quoted string will be reconstructed later ... I'm not sure if this function is not working correctly, or if it might bean issue with 3 wordsnot 2 words in quotes, or a lower/uppercase issue ... HTH a little bit ... Quote KEEP CALM AND CARRY ON I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support). So if you are still here ? What are you waiting for ?! Find the most frequent unique errors to fix: grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt Link to comment Share on other sites More sharing options...
kru Posted December 30, 2011 Author Share Posted December 30, 2011 (edited) Turns out this is a known issue. (Evidently it just wasn't discussed/discovered back in 2006 when I was first looking.) Anyway, I just found the following thread that details a change to be made to advanced_search_result.php: http://forums.oscomm...__fromsearch__1 I made the suggested change and it did produce the desired results. Thanks to wdepot: the user who suggested the fix. For those who don't want to follow the link, here is what he said: "The solution is fortunately VERY simple. In advanced_search_result.php find around line 51 the line that reads like this: $keywords = $HTTP_GET_VARS['keywords']; and CHANGE it to read like this: $keywords = tep_db_prepare_input($HTTP_GET_VARS['keywords']); The development team apparently forgot that they perform addslashes on all $HTTP_GET_VARS and that quote characters therefore have slashes added to them. The code to parse the keywords was correct but the input sent to it is not until run through the tep_db_prepare_input function." Edited December 30, 2011 by kru Quote Add-Ons personally installed:Step by Step Manual Order -- Request Reviews -- Reviews in Product Listing -- Reviews in Product Display -- Review Approval System -- Leverage Browser Cache --Header Tag Controller -- Multilayer SEO Pop Out Menu -- Follow Us Box -- View All Products -- USPS Shipping Labels -- UPS Shipping Labels -- Monthly Sales/Tax Report --htacess Optimisation -- Remove Unused Images -- Master Password -- Admin Change Customer Password -- Database Backup Manager -- Zero Stock Report --Searchbox Search In Descriptions -- Easy Populate 2.76i -- Barcode Rendering -- Admin Sort By Model -- Products Purchased ReportAdd-Ons personally developed:Search for email address, etc in Orders -- Discontinue ProductAdd-Ons installed by others:View Counter -- Site Monitor -- Image Thumbnailer -- Database Optimizer -- Recaptcha -- Discount Coupons -- Add More Fields Link to comment Share on other sites More sharing options...
Juto Posted December 30, 2011 Share Posted December 30, 2011 The official fix is here: http://www.oscommerce.info/confluence/display/OSCOM23/v2.2+to+v2.3.0 Quote Contributions: http://addons.oscommerce.com/info/8010 http://addons.oscommerce.com/info/8204 http://addons.oscommerce.com/info/8681 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.