I have a catalog of games. Every game has its own price. The price is a numeric field.
At the moment I'm building a game catalog filter, and now I'm stuck on implementing the ability to filter products by price. There are two input in the filter form: maximum and minimum price fields.
<div>
Search by price:<br />
from:<input name="min" type="text" value="">
to:<input name="max" type="text" value="">
</div>
By filling in these two fields, the user needs to show the games within the selected price. A few questions, the answers to which will help me get closer to the solution:
1.How do I find out the price of the most expensive and minimal game?
2.This is how in the twig template I check for the presence of the minprice or maxprice parameter in the url.
{% set games = craft.entries().section('games') %}
{% set minprice = craft.app.request.getQueryParam('min') %}
{% if minprice %}
{% do .................. %}
{% endif %}
{% set maxprice = craft.app.request.getQueryParam('max') %}
{% if maxprice %}
{% do .................. %}
{% endif %}
I do not know what to write in my code instead of dots. Help me please with this))