Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Quickfind contrib installed. Need exact string search help.


kru

Recommended Posts

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 by kru

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 Report

Add-Ons personally developed:

Search for email address, etc in Orders -- Discontinue Product

Add-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

  • 2 weeks later...
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... :)

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 Report

Add-Ons personally developed:

Search for email address, etc in Orders -- Discontinue Product

Add-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

  • 5 years later...

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.

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 Report

Add-Ons personally developed:

Search for email address, etc in Orders -- Discontinue Product

Add-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

Anyone?

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 Report

Add-Ons personally developed:

Search for email address, etc in Orders -- Discontinue Product

Add-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

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 ...

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

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:

 

 

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 by kru

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 Report

Add-Ons personally developed:

Search for email address, etc in Orders -- Discontinue Product

Add-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

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...