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 September 6th, 2013, 11:32 AM
atlantistarget atlantistarget is offline
 
Join Date: Aug 2013
Posts: 27
Default Can I have two search boxes which search different categories?

Hello. I have two categories in one store and I would like my clients to search JUST THE PRODUCTS of each category.

Let me explain: I have "ligths" and "accesories" categories. I would like my clients to have the possibility to search ONLY INTO THE LIGHTS PRODUCTS into "lights category" and to search ONLY INTO THE ACCESORIES PRODUCTS into the "accesories category".

How can I do that?

Thanks in advance for your help...

Javier
  #2  
Old September 6th, 2013, 11:44 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi,

To do this, replace the following code here The Factory > Your Store > VIEWS > WIDGETS > Simple Search > Text module

HTML Code:
<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.word onfocus='wash(this);' onblur='checkWash(this);' value='Search store...']
  [search.submit title='Go']
  [/search.form]
</div>
With this code:
HTML Code:
<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.word onfocus='wash(this);' onblur='checkWash(this);' value='Search store...']
  
  <?php if ( @$category->id > 0 ) : ?>
    <input type="hidden" name="c" value="<?php echo $category->id; ?>" />
  <?php endif; ?>
  
  [search.submit title='Go']
  [/search.form]
</div>
Eric
  #3  
Old September 6th, 2013, 11:53 AM
atlantistarget atlantistarget is offline
 
Join Date: Aug 2013
Posts: 27
Default

Thanks Eric. Im not so computer guy...

Then, Do I need to have two search boxes? (One for each category page). Because I only have two pages, each page with th correspondent category products.

I have:

One page with the "lights products" and there I want to put a search box that ONLY searchs into the category "lights products"

Other page with the "Accesories products" and there I want to put a search box that ONLY searchs into the category "category products"
  #4  
Old September 6th, 2013, 11:56 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi,

No, you just need 1 search box. And when a user is viewing a category and then does a search, the search will be limited to just that category.

Eric
 


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
New Trick: Combine Datafeedr product search with Wordpress posts search dhilditch Tips, Tricks & Tutorials 5 April 18th, 2013 05:58 AM
Search for a product by name in save categories digitalcow Feature Requests 1 January 10th, 2013 02:44 PM
Search for Product Name in Advance Search Widget shopecx Questions 2 November 29th, 2012 03:12 PM
Search page only returning certain categories silverjellybean Problems 5 September 23rd, 2012 06:29 PM


All times are GMT -5. The time now is 01:14 PM.


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