I'm trying to use price as a parameter for filtering my Craft Commerce products, but I cannot get it to work. I think the problem is with the way that I'm referring to the product price, but at the same time I'm not sure how to change it so that it will work.
Is it possible to filter by product price as I'm trying to do here ? Does anyone know what exactly I need to change to get my query to work ?
Any pointers in the right direction would be most appreciated.
{% set queryParams = {
relatedTo: category,
price: [
'and',
'>= ' ~ 200,
'<= ' ~ 500,
]
} %}
{% set products = craft.commerce.products(queryParams) %}
{% for product in products %}
....output product data
{% endfor %}