Перейти к содержимому


Фотография
- - - - -

Filter with slider


Лучший Ответ Kess , 30 April 2014 - 00:19

Hello,

There is no such feature in JBZoo.

But, since these values are integers and it seems that the range is not very big, there is a workaround.

First, make this field as a repeatable text element:
k95_200x0.png
Also, copy the Element ID somewhere (in the Notepad, for example), we'll need it later.

Then fill the whole range for you products one-by-one:
us8_200x0.png

Go to the configuration of your item templates (full, teaser etc.) and change separator to 'span':
87s_200x0.png

Now open the files of these templates and find where the position of this element is rendered. For example, the file for a teaser template of 'product' item type is here:

media/zoo/applications/jbuniversal/templates/catalog/renderer/item/product/teaser.php

And the code that we are looking for is this:

<?php echo $this->renderPosition('properties', array('style' => 'list')); ?>

Now change it like this:

<?php echo $this->renderPosition('properties', array('style' => 'jbblock', 'tag' => 'li')); ?>

This will add needed classes to the 'li'.

 

Now add this CSS to your template:

.element-ce4d0a13-cbde-4ab0-89d1-f396593f3f92 span {
    display: none;
}
.element-ce4d0a13-cbde-4ab0-89d1-f396593f3f92 span:first-of-type, .element-ce4d0a13-cbde-4ab0-89d1-f396593f3f92 span:last-of-type {
    display: inline;
}
.element-ce4d0a13-cbde-4ab0-89d1-f396593f3f92 span:first-of-type:after {
    content: ' - ';
}
.element-ce4d0a13-cbde-4ab0-89d1-f396593f3f92 span:last-of-type:after {
    content: 'F';
}

But replace ce4d0a13-cbde-4ab0-89d1-f396593f3f92 with Element ID that you copied before. The only problem with this is that it will not work in Internet Exporer 8 and below.

 

Configure a filter accordingly and it's done.

579_200x0.png

 

ti7_200x0.png

Перейти к сообщению


  • Закрытая тема Тема закрыта
Сообщений в теме: 2

#1 BrewPirate

BrewPirate

Отправлено 29 April 2014 - 18:27

I am having an issue trying to get the filtering to work with this special situation. I have profiles for yeast which have a temperature range at which they work (example 50-70f) and set this with 2 text boxes. However the slider only can look at one value and not a range. Do you have a way for this to work?

 

Module - FIND THAT YEAST

http://www.brewpirat...yeast/ale-yeast

 

 

Sample yeast

http://www.brewpirat...le-yeast-wlp530

which has a Ferment Temp 66 - 72°F

 

How would I make it so when I slide the slider to 68-70 this would pop up in the results?

 

 


  • 0

#2 Kess

Kess

Отправлено 30 April 2014 - 00:19   Лучший Ответ

Hello,

There is no such feature in JBZoo.

But, since these values are integers and it seems that the range is not very big, there is a workaround.

First, make this field as a repeatable text element:
k95_200x0.png
Also, copy the Element ID somewhere (in the Notepad, for example), we'll need it later.

Then fill the whole range for you products one-by-one:
us8_200x0.png

Go to the configuration of your item templates (full, teaser etc.) and change separator to 'span':
87s_200x0.png

Now open the files of these templates and find where the position of this element is rendered. For example, the file for a teaser template of 'product' item type is here:

media/zoo/applications/jbuniversal/templates/catalog/renderer/item/product/teaser.php

And the code that we are looking for is this:

<?php echo $this->renderPosition('properties', array('style' => 'list')); ?>

Now change it like this:

<?php echo $this->renderPosition('properties', array('style' => 'jbblock', 'tag' => 'li')); ?>

This will add needed classes to the 'li'.

 

Now add this CSS to your template:

.element-ce4d0a13-cbde-4ab0-89d1-f396593f3f92 span {
    display: none;
}
.element-ce4d0a13-cbde-4ab0-89d1-f396593f3f92 span:first-of-type, .element-ce4d0a13-cbde-4ab0-89d1-f396593f3f92 span:last-of-type {
    display: inline;
}
.element-ce4d0a13-cbde-4ab0-89d1-f396593f3f92 span:first-of-type:after {
    content: ' - ';
}
.element-ce4d0a13-cbde-4ab0-89d1-f396593f3f92 span:last-of-type:after {
    content: 'F';
}

But replace ce4d0a13-cbde-4ab0-89d1-f396593f3f92 with Element ID that you copied before. The only problem with this is that it will not work in Internet Exporer 8 and below.

 

Configure a filter accordingly and it's done.

579_200x0.png

 

ti7_200x0.png


Сообщение отредактировал Kess: 30 April 2014 - 00:27

  • 0

#3 isay777

isay777

Отправлено 30 April 2014 - 16:44

it's awesome. Thx


  • 0
ХОСТИНГ для сайтов jbzoo (все попугаи)




Click to return to top of page in style!