We’re currently working on http://goo.gl/Cxk5Aw and the client would like to add a price min / max filter on the sidebar, but we’re having an issue with keeping the segments of the url clean. I was curious if it was possible to add the min / max into our drop-down menu and have the data stored in segment_3 like we have for the pagination entry display value & sort by?
Current Code:
Drop Down List
{exp:dynamo:form return="products/specials" search_id="{segment_3}" id="options_form"}
<p>Show <select class="form_option" name="limit">
<option value="9" {if limit == 9} selected="selected"{/if}> 9 </option>
<option value="18" {if limit == 18} selected="selected"{/if}> 18 </option>
<option value="27" {if limit == 27} selected="selected"{/if}> 27 </option>
</select>
per page</p>
<p>Sort by <select class="form_option" name="orderby">
<option value="title" {if orderby == 'title'} selected="selected"{/if}> Name </option>
<option value="price" {if orderby == 'price'} selected="selected"{/if}> Price </option>
</select></p>
{/exp:dynamo:form}
JavaScript:
<script type="text/javascript">
$(document).ready(function() {
$('.form_option').change(function(e){
console.log('Change');
$('#options_form').submit();
});
});
</script>
Store Code:
{exp:store:search channel="products" limit="9" dynamic="yes" orderby="date" sort="desc" dynamic_parameters="limit|orderby" search_id="{segment_3}" paginate="both" search:on_sale="yes"}
{exp:store:product entry_id="{entry_id}" form_class="form-horizontal" return="store/shopping-cart"}