Datafeedr Support Forums  

Go Back   Datafeedr Support Forums > Current Version (V3) Forum > Tips, Tricks & Tutorials
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 February 3rd, 2012, 03:20 PM
sdc247 sdc247 is offline
 
Join Date: Jan 2012
Posts: 38
Default Filter onsale items

Is there a way to filter my onsale items? I would like to have a search area that will only search my onsale page. This search field will only be displayed on my onsale page only. So if a person is searching for HDMI cable it will only bring back those items that are on sale.

James
sdc24-7.com
  #2  
Old February 3rd, 2012, 05:32 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi

I guess you could add the following code to your Search Widget. This will add a saleprice parameter to the search results.

HTML Code:
<input type="hidden" name="saleprice" value="1-" />
Therefore your Simple Search widget would look like this:

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...']
  <input type="hidden" name="saleprice" value="1-" />
  [search.submit title='Go']
  [/search.form]
</div>
Eric
  #3  
Old February 7th, 2012, 05:56 PM
sdc247 sdc247 is offline
 
Join Date: Jan 2012
Posts: 38
Default

Okay thank you, That fixed a different problem. However that still does not do what I need. What I want is when a viewer is on my "Onsale" page and they use the search field, I only want items to show that are on sale only. However if they are on any other page I want the search to bring back normal searches. I hope I am making sense.

James
  #4  
Old February 7th, 2012, 07:14 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi

Then you'd need something like this (if your search page is here: /store/search):

HTML Code:
<div class="store_search_form">
  [search.form]
  [search.word onfocus='wash(this);' onblur='checkWash(this);' value='Search store...']
  <?php if (preg_match("/store\/search/i", $_SERVER['REQUEST_URI'])) { ?>
	  <input type="hidden" name="saleprice" value="1-" />
  <?php } ?>
  [search.submit title='Go']
  [/search.form]
</div>
Eric
  #5  
Old November 6th, 2012, 07:52 PM
tcsar757 tcsar757 is offline
 
Join Date: Dec 2010
Posts: 47
Default

Could i make a new widget and show it only on the sale items page with this code or is there another code i should use or another way to set it up so i can make a widget for only sale page for searching only sale items.
Thanks
  #6  
Old November 7th, 2012, 01:03 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Quote:
Originally Posted by tcsar757 View Post
Could i make a new widget and show it only on the sale items page with this code or is there another code i should use or another way to set it up so i can make a widget for only sale page for searching only sale items.
Thanks
Sure, you could add a text widget to your sidebar with the following info:
HTML Code:
<form method="get">
	<input type="hidden" name="saleprice" value="1-" />
	<input type="submit" value="Show On Sale Items" />
</form>
  #7  
Old November 7th, 2012, 08:25 PM
tcsar757 tcsar757 is offline
 
Join Date: Dec 2010
Posts: 47
Default

Sorry maybe i was not clear enough, I want to have a seperate search widget that will only search sale items on my sale items page while simple search widget searches rest of store.Thats what i thought this code was supposed to do.
  #8  
Old November 7th, 2012, 10:32 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi,

You can create a new widget, add a text module to that widget with the following 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">
  <form method="get" action="http://www.YOURSITE.com/store/search">
	  [search.word onfocus='wash(this);' onblur='checkWash(this);' value='Search store...']
	  <input type="hidden" name="saleprice" value="1-" />
	  [search.submit title='Go']
  </form>
</div>
Make sure you change http://www.YOURSITE.com/store/search to your site's search page.

Then add that new widget to only your search page using the Widget Context plugin.

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
'Remove Price filter' like brand filter Giftoly Questions 1 January 20th, 2012 10:48 AM
Sale Items seoandbeyond Questions 3 October 31st, 2011 08:59 PM
Filter to find items on sale? rexmtn Questions 3 March 5th, 2011 09:08 AM


All times are GMT -5. The time now is 04:50 AM.


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