Datafeedr Support Forums  

Go Back   Datafeedr Support Forums > Current Version (V3) Forum > Questions
Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Important - The support forums are now in "read-only" mode as we transition to an alternative help desk solution. Feel free to contact us here with any of your questions or search the forums for an existing solution.
 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 20th, 2015, 10:28 AM
yankeestonk yankeestonk is offline
 
Join Date: Jun 2013
Posts: 605
Default search bar searching by tag instead of title

http://saveongolf.net
saveongolfcopy is the store

I just realized my main search bar is searching by tag rather than title or description. I forgot how to change that. Somewhere in the redesign it must have been switched. A search for "Titleist" for instance grabs all sorts of results from companies that for some unknown reason put other manufacturer names in their tags.

This is the code I'm looking at for simple search

<script type="text/javascript">
<!--
/*
* NOTE: This JS code would be much better off
* existing in your theme's header.php file.
*/
function wash( anInput ) { if(anInput.value == anInput.defaultValue) anInput.value = ''; }
function checkWash( anInput ) { if(anInput.value == '') anInput.value = anInput.defaultValue; }
//-->
</script>

<div class="store_search_form">
[search.form]
[search.name onfocus='wash(this);' onblur='checkWash(this);' value='Refine search...']
[search.submit title='Go']
<input type="checkbox" name="saleprice" value="1-" />On Sale
[/search.form]
</div>


...and this is the code in the widget area of my wordpress site!

<form role="search" method="get" id="searchform" class="search-form" action="/store/search/">
<div><label class="screen-reader-text" for="s">Search for:</label>
<input class="search-field" type="text" name="word" id="s" value="<?php echo esc_attr( @$_GET['word'] ); ?>">
<input class="search-submit" type="submit" id="searchsubmit" value="Search"><input name="saleprice" value="1-" type="checkbox"><strong style="color:#fff;margin-top: 5px; display: inline-table; margin-left: 5px; float: left;">On sale</strong>
</div></form>


Thanks!
ken

Last edited by yankeestonk : January 20th, 2015 at 10:43 AM. Reason: adding code
  #2  
Old January 20th, 2015, 10:45 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi

Both of those search forms are searching title, description and tag fields.

Eric
  #3  
Old January 20th, 2015, 10:50 AM
yankeestonk yankeestonk is offline
 
Join Date: Jun 2013
Posts: 605
Default

Can you show me how to get rid of the search by tag from both?
  #4  
Old January 20th, 2015, 10:56 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi

That's not possible. The "word" tag searches those 3 fields. If you want, you can change "word" to "name" to only search the product names.

Replace all occurrences of name="word" with name="name".

Eric
  #5  
Old January 20th, 2015, 11:00 AM
yankeestonk yankeestonk is offline
 
Join Date: Jun 2013
Posts: 605
Default

I only see the one, does the below look correct to you? The one I'd be changing is the one in wordress widget. Also, can it search both title and description for name. I'm not sure if that's what you meant by not possible.

<script type="text/javascript">
<!--
/*
* NOTE: This JS code would be much better off
* existing in your theme's header.php file.
*/
function wash( anInput ) { if(anInput.value == anInput.defaultValue) anInput.value = ''; }
function checkWash( anInput ) { if(anInput.value == '') anInput.value = anInput.defaultValue; }
//-->
</script>

<div class="store_search_form">
[search.form]
[search.name onfocus='wash(this);' onblur='checkWash(this);' value='Refine search...']
[search.submit title='Go']
<input type="checkbox" name="saleprice" value="1-" />On Sale
[/search.form]
</div>


...and this is the code in the widget area of my wordpress site!

<form role="search" method="get" id="searchform" class="search-form" action="/store/search/">
<div><label class="screen-reader-text" for="s">Search for:</label>
<input class="search-field" type="text" name="name" id="s" value="<?php echo esc_attr( @$_GET['word'] ); ?>">
<input class="search-submit" type="submit" id="searchsubmit" value="Search"><input name="saleprice" value="1-" type="checkbox"><strong style="color:#fff;margin-top: 5px; display: inline-table; margin-left: 5px; float: left;">On sale</strong>
</div></form>

Last edited by yankeestonk : January 20th, 2015 at 11:02 AM.
  #6  
Old January 20th, 2015, 11:04 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

If you use name="name", then the search will ONLY search the products' names.

If you use name="word", the the search will search the products' names, descriptions AND tags.
  #7  
Old January 20th, 2015, 11:13 AM
yankeestonk yankeestonk is offline
 
Join Date: Jun 2013
Posts: 605
Default

Ok, thanks. Is the code above right? I ask because you said "replace all instances of name="word" ... I only found one. Is that code above right?
  #8  
Old January 20th, 2015, 11:24 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Looks fine to me but I haven't tested it. There should only be one occurrence of that line.
  #9  
Old January 20th, 2015, 11:25 AM
yankeestonk yankeestonk is offline
 
Join Date: Jun 2013
Posts: 605
Default

ok I'm going in! Thanks.
  #10  
Old January 20th, 2015, 11:40 AM
yankeestonk yankeestonk is offline
 
Join Date: Jun 2013
Posts: 605
Default

it worked! Thanks so much again.
  #11  
Old January 20th, 2015, 11:42 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Great! You're welcome!
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
search box not searching datafeed results yankeestonk Questions 5 September 27th, 2014 10:04 AM
Search by title mcleare Questions 2 May 2nd, 2013 02:40 PM


All times are GMT -5. The time now is 06:25 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.