4
I have a page in a system where I list the products registered in BD, I am implementing some filters within this page, and I would like to update the links of the filters as requested in the URL (GET REQUEST):
When starting the links the filters contained therein shall start as follows:
Category
<a href="meusite.com.br/produtos?_categoria=1">Categoria 1</a>
<a href="meusite.com.br/produtos?_categoria=2">Categoria 2</a>
<a href="meusite.com.br/produtos?_categoria=3">Categoria 3</a>
Numbering
<a href="meusite.com.br/produtos?_numeracao=34">34</a>
<a href="meusite.com.br/produtos?_numeracao=35">35</a>
<a href="meusite.com.br/produtos?_numeracao=36">36</a>
If the user accesses the page filter the link`s shall update as follows:
If you access the filter category the links from the filter numbering should stay:
<a href="meusite.com.br/produtos?_categoria=1&_numeracao=34">34</a>
<a href="meusite.com.br/produtos?_categoria=1&_numeracao=35">35</a>
<a href="meusite.com.br/produtos?_categoria=1&_numeracao=36">36</a>
If you access the filter numbering the links filter category should stay:
<a href="meusite.com.br/produtos?_categoria=1&_numeracao=34">Categoria 1</a>
<a href="meusite.com.br/produtos?_categoria=2&_numeracao=34">Categoria 2</a>
<a href="meusite.com.br/produtos?_categoria=3&_numeracao=34">Categoria 3</a>
I would like a direction where to start, because I am not found the logic of how to do.
You want to get the values or keep them in the URL?
– Jorge B.
@Jorgeb.I want to keep in the URL take the values and insert in the filter link.
– Vitor Molina
You asked a question thinking it’s the best way to create a filter for your products, but you don’t have the slightest idea of a logic for it. I advise you to show what you have and not just a part. And ask more concise questions.
– Lollipop