V
V
Victor Umansky2017-08-23 13:23:27
Yii
Victor Umansky, 2017-08-23 13:23:27

How to properly connect kartik range slider to ProductPitSearch?

Hello.
Can you please explain how to properly connect kartik range slider to ProductPitSearch or do I need a separate form for it???
If separately, then how then to search and output correctly ???
f6817444f3d748abbf893978ccd68ae4.jpg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2017-08-23
@Uman

You have a ProductPitSearch model
, it should have a price attribute, respectively, a string with min and max separated by commas will fall into it. Let's make an array out of it:
now add a filter:

$query->filterWhere([
'and',
['>', 'somePriceAttr', $this->price[0]],
['<', 'somePriceAttr', $this->price[1]]
]);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question