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 11th, 2011, 06:21 AM
digitalcow digitalcow is offline
 
Join Date: Jun 2010
Posts: 494
Default Auto reload of the categories

Would this possible

I have set up pages on my site to be sortable by price/product name and also to allow the user to change how many products they see in the listings. At the moment you need to select the drop down for the option you wish to use and then click on the go button to the right. As many other websites would auto reload without needing the user to click 'go' it could give the user the impression that the option doesn't work.

Therefore, would it be possible to have it so that the reload is activated when an option is selected?
  #2  
Old January 11th, 2011, 08:35 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

If you are using code like this for generating your drop down menus...
Code:
<select name="ppp" class="dfppp">
	<option value="12"<?php if (@$_GET['ppp']==12) {echo ' selected="selected"';}?>>12</option>
	<option value="24"<?php if (@$_GET['ppp']==24) {echo ' selected="selected"';}?>>24</option>
	<option value="36"<?php if (@$_GET['ppp']==36) {echo ' selected="selected"';}?>>36</option>
	<option value="48"<?php if (@$_GET['ppp']==48) {echo ' selected="selected"';}?>>48</option>
</select>
... then you could easily apply this technique: http://snippets.dzone.com/posts/show/785

Eric
  #3  
Old January 11th, 2011, 10:19 AM
digitalcow digitalcow is offline
 
Join Date: Jun 2010
Posts: 494
Default

thanks, should have realised that this was controlled by the code rather than the factory
  #4  
Old January 14th, 2011, 11:52 AM
ayorofrance ayorofrance is offline
 
Join Date: Sep 2010
Posts: 430
Default

Great tip!
__________________
WordPress Security - Is your WordPress secure? Get our FREE checklist and find out.

Easy-Email - Access ALL your email accounts with one login & synchronize automatically on all your computers.
  #5  
Old January 15th, 2011, 06:24 PM
ayorofrance ayorofrance is offline
 
Join Date: Sep 2010
Posts: 430
Default

Hi Eric,

Has the template code for the sorting template been updated recently?

I now get this code:
Code:
<div class="dffltrs">
  <form method="get">
    <span class="dflside">
      Products per page:
      <?php echo datafeedr_tools()->form_select("ppp",
        array(
        "12" => "12",
        "24" => "24",
        "36" => "36",
        "48" => "48",
        )); ?>
    </span>
    <span class="dfrside">
      Sort by:
      <?php echo datafeedr_tools()->form_select("sort",
        array(
        "price"   => "Price (low to high)",
        "-price"   => "Price (high to low)",
        "name"     => "Product Name (a - z)",
        "-name"   => "Product Name (z - a)",
        )); ?>
      <input type="submit" value="Go" class="dfsbmt" />
    </span>
    <div class="clearingdiv">&nbsp;</div>
  </form>
</div>
Will I have to revert back to the 'old' code to use the auto-submit?

Are there any drawbacks to using the old code?

Thanks!
__________________
WordPress Security - Is your WordPress secure? Get our FREE checklist and find out.

Easy-Email - Access ALL your email accounts with one login & synchronize automatically on all your computers.
  #6  
Old January 15th, 2011, 06:52 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Quote:
Originally Posted by ayorofrance View Post
Has the template code for the sorting template been updated recently?

Will I have to revert back to the 'old' code to use the auto-submit?

Are there any drawbacks to using the old code?
Hi

Yes, the template code has changed but it does exactly the same things as the old code. We just tried to simplify the code that you saw.

There are no drawbacks to using the old code. They do the same thing.

You will have to use the old code if you want to apply the auto submit modification for now. Here's the code in case anyone is looking for it:

Code:
<div class="dffltrs">
  <form method="get">  
    <span class="dflside">
      Products per page:
      <select name="ppp" class="dfppp">
        <option value="12"<?php if (@$_GET['ppp']=='12') {echo ' selected="selected"';}?>>12</option>
        <option value="24"<?php if (@$_GET['ppp']=='24') {echo ' selected="selected"';}?>>24</option>
        <option value="36"<?php if (@$_GET['ppp']=='36') {echo ' selected="selected"';}?>>36</option>
        <option value="48"<?php if (@$_GET['ppp']=='48') {echo ' selected="selected"';}?>>48</option>
      </select>
    </span>
    <span class="dfrside">
      Sort by:
      <select name="sort" class="dfsort">
        <option value="price"<?php if (@$_GET['sort']=='price') {echo ' selected="selected"';}?>>Price (low to high)</option>
        <option value="-price"<?php if (@$_GET['sort']=='-price') {echo ' selected="selected"';}?>>Price (high to low)</option>
        <option value="name"<?php if (@$_GET['sort']=='name') {echo ' selected="selected"';}?>>Product Name (a - z)</option>    
        <option value="-name"<?php if (@$_GET['sort']=='-name') {echo ' selected="selected"';}?>>Product Name (z - a)</option>    
      </select>
      <input type="submit" value="Go" class="dfsbmt" />
    </span>
    <div class="clearingdiv">&nbsp;</div>
  </form>
</div>
  #7  
Old November 10th, 2011, 04:13 PM
jackrock jackrock is offline
 
Join Date: Oct 2011
Posts: 40
Default

Hi, I applied the above code to my default store category, and it doesn't automatically update. I still have to click "Go" as before.

http://www.wirelessheadphones.cc/sto...ss-headphones/
__________________
Jack
  #8  
Old November 10th, 2011, 04:19 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Quote:
Originally Posted by jackrock View Post
Hi, I applied the above code to my default store category, and it doesn't automatically update. I still have to click "Go" as before.

http://www.wirelessheadphones.cc/sto...ss-headphones/
The above code has nothing to do with auto submitting the form. To auto submit, try this:

http://www.htmlgoodies.com/beyond/ja...mit-Button.htm
  #9  
Old November 10th, 2011, 05:50 PM
jackrock jackrock is offline
 
Join Date: Oct 2011
Posts: 40
Default

Where do I put this code (assuming this is the right code)?:

<select name='myfield' onchange='this.form.submit()'>
<option selected>Milk</option>
<option>Coffee</option>
<option>Tea</option>
</select>
<noscript><input type="submit" value="Submit"></noscript>
__________________
Jack
  #10  
Old November 10th, 2011, 05:52 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Quote:
Originally Posted by jackrock View Post
Where do I put this code (assuming this is the right code)?:

<select name='myfield' onchange='this.form.submit()'>
<option selected>Milk</option>
<option>Coffee</option>
<option>Tea</option>
</select>
<noscript><input type="submit" value="Submit"></noscript>
This has been addressed here: /showthread.php?t=3786
 


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


All times are GMT -5. The time now is 12:55 PM.


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