// Blocklayered: Slider could be change with two inputs or a list of values

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10822 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
mDeflotte
2011-12-01 09:16:10 +00:00
parent bca384dc71
commit 0c87d98914
5 changed files with 132 additions and 58 deletions
+14
View File
@@ -2361,6 +2361,20 @@ class BlockLayered extends Module
if ($priceArray['max'] != $priceArray['min'] && $priceArray['min'] != null)
{
if ($filter['filter_type'] == 2)
{
$priceArray['list_of_values'] = array();
$nbr_of_value = $filter['filter_show_limit'];
if ($nbr_of_value < 2)
$nbr_of_value = 4;
$delta = ($priceArray['max'] - $priceArray['min']) / $nbr_of_value;
$current_step = $priceArray['min'];
for ($i = 0; $i < $nbr_of_value; $i++)
$priceArray['list_of_values'][] = array(
(int)($priceArray['min'] + $i * $delta),
(int)($priceArray['min'] + ($i + 1) * $delta)
);
}
if (isset($selectedFilters['price']) && isset($selectedFilters['price'][0])
&& isset($selectedFilters['price'][1]))
{