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 December 8th, 2011, 10:49 AM
webnamescouk webnamescouk is offline
 
Join Date: Nov 2011
Posts: 65
Default A better sort (html select) method

Hey,
Currently i use this snippet of code to allow the user to sort their products and limit the amount they can view:

Code:
<div class="dffltrs">
<form method="get">
<span class="dflside">

      Products per page:
      <select name="ppp" class="dfppp" onchange='this.form.submit()'>
        <option value="">Select amount</option>
        <option value="10">10</option>
        <option value="20">20</option>
        <option value="30">30</option>
        <option value="40">40</option>
        <option value="50">50</option>
        <option value="60">60</option>
  </select>
  </span>
  <span class="dfrside">

          Sort by:

      <select name="sort" class="dfsort" onchange='this.form.submit()'>
        <option value="" select="selected">Select a Filter</option>
        <option value="price">Price (low to high)</option>
        <option value="-price">Price (high to low)</option>
        <option value="name">Product Name (a - z)</option>
        <option value="-name">Product Name (z - a)</option>
  </select>
  </span>
  </form>
</div>
The only problem i have is that I'd rather it be enabled so that if they limit by 50 products, then the 50 option is
Code:
select="selected"
but I have no idea how to do it, do you have any suggestions?
At current I've made it so by default it just goes back to "Select a Filter" or "Select amount"
Thanks,
Matt
  #2  
Old December 8th, 2011, 11:15 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi

If you use this method, then you don't have to worry about it:

PHP 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>
Eric
  #3  
Old December 8th, 2011, 11:54 AM
webnamescouk webnamescouk is offline
 
Join Date: Nov 2011
Posts: 65
Default

Thanks, perfect!
  #4  
Old December 12th, 2011, 05:22 AM
webnamescouk webnamescouk is offline
 
Join Date: Nov 2011
Posts: 65
Default

Hey,
Just tested it this morning and it doesn't quite work as expected.
When i click any of the options nothing is updated just the item selected!
  #5  
Old December 12th, 2011, 07:24 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi

Have you allowed override in your view's product list module's settings?

Eric
  #6  
Old December 12th, 2011, 07:45 AM
webnamescouk webnamescouk is offline
 
Join Date: Nov 2011
Posts: 65
Default

Hey,
Due to the them I didn't notice the "Go" button, all working
Now to theme the button so others and myself can see it
Thanks.
 


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
same product select size Papada Feature Requests 0 November 23rd, 2011 12:48 AM
How to select only one product in a series? rexmtn Questions 1 March 17th, 2011 08:47 AM
How to Auto select active merchants ? neosurya Questions 3 January 23rd, 2011 11:45 AM
Fatal error: Call to undefined method Datafeedr_ShopView::form_tag() Eric Problems 0 January 22nd, 2011 09:30 AM


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.