A
A
Alexander Verbitsky2018-08-09 01:50:31
Yii
Alexander Verbitsky, 2018-08-09 01:50:31

How to do filtering correctly, along with sorting (both are passed via GET)?

Good afternoon!
There is a sorting of goods
5b6b71bc28d35103430036.png
and there is a filtering
5b6b71ee7c62a122331395.png
When I click on sorting, the GET parameter "sort" appears in the address bar. 5b6b728bae6ac361833704.png
And when I select a color in the filter, I click on "Apply Filter" the previous GET parameter "sort" is overwritten, and instead the parameter "color" appears. ...
5b6b738f98f6e585209258.png
How to make sure that one does not interfere with the other, and if I uncheck the previously selected color and put a new one, that one is lost, and the new one appears without overwriting "sort" ....
I hope I explained it clearly. Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lumore, 2018-08-09
@VerbAlexVlad

It is just necessary that these fields were in one form. I think, in your case, you can make a form with hidden inputs and assign values ​​​​through js (only when you need to display the filter and sort in different places).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question