Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Restoring 'Searches in Description' functionality of header search box


Recommended Posts

So the search box in header does not search keywords in product description at all even if you set 'My Store -> QuickSearch searches in description' in admin to 'true'.  To enable searches in description again, in 'includes\modules\content\header\ cm_header_search.php', I added the following line of code:

$search_box .=  tep_draw_hidden_field('search_in_description', QUICKSEARCH_IN_DESCRIPTION == 'true' ? '1' : '0');

ABOVE the following existing line of code:

$search_box .=  tep_hide_session_id() . '</form>';

It works, but I am not sure if I'm doing it correctly.  Thanks in advance for any advice.

 

I'm using BS Edge.

 

Cheers, Eddy

Link to comment
Share on other sites

@@Moxamint

 

Eddy,

 

There is no option in admin "My Store -> QuickSearch" and there is no hidden field for 'search_in_description' in cm_header_search.php (what you've tried to add is in the right location though).

 

If you're looking to enable 'search_in_description' in the quick search bar based on your setting for "Twitter Typeahead Autocomplete" add this above the line of code you specified above:

$search_box .= (defined('MODULE_HEADER_TAGS_TWITTER_TYPEAHEAD_SEARCH_IN_DESCRIPTION') && MODULE_HEADER_TAGS_TWITTER_TYPEAHEAD_SEARCH_IN_DESCRIPTION == 'true' ? tep_draw_hidden_field('search_in_description', '1') : '');

cheers

My Add-ons
Advanced Cache Control Tool for osCommerce 2.3.x (non-bootstrap) Download Support
Ajax Product Listing for osC 2.3.4 (bootstrap) Download Support
Category New Products Carousel for osC 2.3.4 (bootstrap) Download Support
Category Popular Products Carousel for osC 2.3.4 (bootstrap) Download Support
Customer Testimonials for osCommerce 2.3.4 (bootstrap and non-bootstrap) Download Support
Front Page New Products Carousel for osC 2.3.4 (bootstrap) Download Support

Index Nested - Product Listing for osC 2.3.4 (bootstrapDownload Support
Match Categories in Search Results for osCommerce versions 2.3.x (non-bootstrap) Download Support
Modular Category Page for osC 2.3.4 (bootstrap)
Download Support

NEW Australia Post Shipping Modules for osCommerce 2.3.x (non-bootstrap) Download Support
NEW Equal Height Module for osC 2.3.4 (bootstrapDownload Support
Products Low Stock Report for osC 2.3.x (bootstrap and non-bootstrap) Download Support
Twitter Typeahead Autocomplete Search for osCommerce 2.3.4 (bootstrap and non-bootstrap)
Download Support

Upcoming Products Modules for osC 2.3.4 (bootstrap) Download Support

 
Assisted Add-ons
Scroll Boxes for osCommerce 2.3.x (bootstrap and non-bootstrap) Download Support
 
Bootstrap Add-ons created by other members
osCommerce Bootstrap Addons and Code

Link to comment
Share on other sites

@@auzStar

 

Thanks a lot Dominic and you were right - there is no option in admin "My Store -> QuickSearch".  I added that configuration entry myself when installing add-on "Extra Product Fields" last year and I forgot all about it...

 

Now the behavior of the quick search bar is consistent with your "Twitter Typeahead Autocomplete".

 

Thanks again, Eddy

Link to comment
Share on other sites

  • 1 year later...

I've been running a site for thirteen years using 2.2 and have had enough of fixing things.

I just installed the newest version of osCommerce (2.3.4.1 CE) and my head is spinning with all of these new files and modules.  It's very cool, though!

I need buyers to be able to search titles AND descriptions and have no desire to install another search contribution, so do this:

Open Catalog>Includes>Modules>Content>Header>/cm_header_search.php

Find this line, roughly in the middle of the file:

$search_box .=  tep_hide_session_id() . '</form>';

Directly above it...put this:

$search_box .= tep_draw_hidden_field('search_in_description', '1');

Now, your search box in the header will return results for keywords in both titles and descriptions.

Thanks to the previous posters for pointing me in the right direction!

- Andrea

Link to comment
Share on other sites

I just installed the twitter typehead search. https://apps.oscommerce.com/c1sKS&twitter-typeahead-autocomplete-search

Its a module so you just upload the files, turn the old module off and turn the new one one. Real easy now. No code changes what ever. Anyone altering the core code on the CE version wants to learn to do things properly.

REMEMBER BACKUP, BACKUP AND BACKUP

Link to comment
Share on other sites

The code modification above for "search in description" is only required for the BS version of osCommerce when using the included quick search that appears in the header, where you might want to enable "search in description" functionality. The box module versions of quick search (and the advanced search) for both BS and non-BS already have this code. I discovered this a while back when testing for the twitter typeahead search add-on for both the BS and non-BS version when people asked if I could include a "search in description" option in the add-on.

Regardless, if some-one still wants to have the functionality of "search in description" from the header quick search in the BS version without installing other search add-ons then they would need to make the modification to the header quick search module. Don't know why the "search in description" code was not included in the header quick search of the BS version.

cheers

My Add-ons
Advanced Cache Control Tool for osCommerce 2.3.x (non-bootstrap) Download Support
Ajax Product Listing for osC 2.3.4 (bootstrap) Download Support
Category New Products Carousel for osC 2.3.4 (bootstrap) Download Support
Category Popular Products Carousel for osC 2.3.4 (bootstrap) Download Support
Customer Testimonials for osCommerce 2.3.4 (bootstrap and non-bootstrap) Download Support
Front Page New Products Carousel for osC 2.3.4 (bootstrap) Download Support

Index Nested - Product Listing for osC 2.3.4 (bootstrapDownload Support
Match Categories in Search Results for osCommerce versions 2.3.x (non-bootstrap) Download Support
Modular Category Page for osC 2.3.4 (bootstrap)
Download Support

NEW Australia Post Shipping Modules for osCommerce 2.3.x (non-bootstrap) Download Support
NEW Equal Height Module for osC 2.3.4 (bootstrapDownload Support
Products Low Stock Report for osC 2.3.x (bootstrap and non-bootstrap) Download Support
Twitter Typeahead Autocomplete Search for osCommerce 2.3.4 (bootstrap and non-bootstrap)
Download Support

Upcoming Products Modules for osC 2.3.4 (bootstrap) Download Support

 
Assisted Add-ons
Scroll Boxes for osCommerce 2.3.x (bootstrap and non-bootstrap) Download Support
 
Bootstrap Add-ons created by other members
osCommerce Bootstrap Addons and Code

Link to comment
Share on other sites

On 5/26/2018 at 6:57 AM, 14steve14 said:

I just installed the twitter typehead search. https://apps.oscommerce.com/c1sKS&twitter-typeahead-autocomplete-search

Its a module so you just upload the files, turn the old module off and turn the new one one. Real easy now. No code changes what ever. Anyone altering the core code on the CE version wants to learn to do things properly.

I'm not clear.....after reading about that twitter typehead addon, does it do what the poster above you described? As far as searching in product descriptions as well as product titles?

Link to comment
Share on other sites

@brian_cee

Just to be clear the typehead addon was originally created to work with the existing "quick search" in the header, it doesn't replace or alter the "quick search" module. And it was originally created to not "search in description". The reason (back then) was so that it matched the "quick search" results, which does not search in description.

But to answer your question, yes, the latest version of twitter typehead addon has an option to "search in description", among other settings for how the description results look in the search result drop down list.

The option to enable "search in description" is there now (to have on or off), but be aware that the "quick search" header module which is included with osCommerce BS version (2.3.4.1 CE) doesn't search in description. But some people want the standard "quick search" to "search in description" regardless of whether or not they have the typehead addon installed, so they are making the code modification as suggested above to the "quick search" module.

Hope that helps.

cheers

My Add-ons
Advanced Cache Control Tool for osCommerce 2.3.x (non-bootstrap) Download Support
Ajax Product Listing for osC 2.3.4 (bootstrap) Download Support
Category New Products Carousel for osC 2.3.4 (bootstrap) Download Support
Category Popular Products Carousel for osC 2.3.4 (bootstrap) Download Support
Customer Testimonials for osCommerce 2.3.4 (bootstrap and non-bootstrap) Download Support
Front Page New Products Carousel for osC 2.3.4 (bootstrap) Download Support

Index Nested - Product Listing for osC 2.3.4 (bootstrapDownload Support
Match Categories in Search Results for osCommerce versions 2.3.x (non-bootstrap) Download Support
Modular Category Page for osC 2.3.4 (bootstrap)
Download Support

NEW Australia Post Shipping Modules for osCommerce 2.3.x (non-bootstrap) Download Support
NEW Equal Height Module for osC 2.3.4 (bootstrapDownload Support
Products Low Stock Report for osC 2.3.x (bootstrap and non-bootstrap) Download Support
Twitter Typeahead Autocomplete Search for osCommerce 2.3.4 (bootstrap and non-bootstrap)
Download Support

Upcoming Products Modules for osC 2.3.4 (bootstrap) Download Support

 
Assisted Add-ons
Scroll Boxes for osCommerce 2.3.x (bootstrap and non-bootstrap) Download Support
 
Bootstrap Add-ons created by other members
osCommerce Bootstrap Addons and Code

Link to comment
Share on other sites

16 hours ago, brian_cee said:

I'm not clear.....after reading about that twitter typehead addon, does it do what the poster above you described? As far as searching in product descriptions as well as product titles?

It does on mine and I dont think I changed anything.

REMEMBER BACKUP, BACKUP AND BACKUP

Link to comment
Share on other sites

12 hours ago, 14steve14 said:

It does on mine and I dont think I changed anything.

 

I think you'll find the twitter typehead add-on does, but "quick search" doesn't by default.

cheers

My Add-ons
Advanced Cache Control Tool for osCommerce 2.3.x (non-bootstrap) Download Support
Ajax Product Listing for osC 2.3.4 (bootstrap) Download Support
Category New Products Carousel for osC 2.3.4 (bootstrap) Download Support
Category Popular Products Carousel for osC 2.3.4 (bootstrap) Download Support
Customer Testimonials for osCommerce 2.3.4 (bootstrap and non-bootstrap) Download Support
Front Page New Products Carousel for osC 2.3.4 (bootstrap) Download Support

Index Nested - Product Listing for osC 2.3.4 (bootstrapDownload Support
Match Categories in Search Results for osCommerce versions 2.3.x (non-bootstrap) Download Support
Modular Category Page for osC 2.3.4 (bootstrap)
Download Support

NEW Australia Post Shipping Modules for osCommerce 2.3.x (non-bootstrap) Download Support
NEW Equal Height Module for osC 2.3.4 (bootstrapDownload Support
Products Low Stock Report for osC 2.3.x (bootstrap and non-bootstrap) Download Support
Twitter Typeahead Autocomplete Search for osCommerce 2.3.4 (bootstrap and non-bootstrap)
Download Support

Upcoming Products Modules for osC 2.3.4 (bootstrap) Download Support

 
Assisted Add-ons
Scroll Boxes for osCommerce 2.3.x (bootstrap and non-bootstrap) Download Support
 
Bootstrap Add-ons created by other members
osCommerce Bootstrap Addons and Code

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...