We try to create a custom from-to price filter on our Magento homepage.
We're using a Layered Navigation extension and we can't find a way to understand the price algorithm.
We have two static HTML select boxes. One for the from price and one for the to price. We combine the values from the selected options to one URL with jQuery.
But this unfortunately gives very strange results. Below some examples:
From 10 to 20 gives € 180 - € 200
From 20 to 30 gives € 570 - € 600
From 30 to 40 gives € 1160 - € 1200
How we can access the correct algorithm within our static select option values?
Please see our code below:
<form> <select class="price"> <option value="1">0</option> <option value="10">10</option> <option value="20">20</option> <option value="30">30</option> <option value="40">40</option> </select> <select class="price"> <option value="">no max</option> <option value="10">10</option> <option value="20">20</option> <option value="30">30</option> <option value="40">40</option> </select> </form> <a href="" id="search">Zoeken</a> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" ></script> <script type="text/javascript"> $('#search').click(function (e) { e.preventDefault(); var price = $('.price option:selected').map(function () { return this.value; }).get().join(','); window.location.href = '/category/filter/price/' + price; }); </script>