Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Use "minimal_variant_price" instead of "price" to filter Products

Mateusz Dereniowski8481d7f5322f
diff --git a/saleor/product/filters.py b/saleor/product/filters.py
index 234effe33f..771ae851e3 100644
--- a/saleor/product/filters.py
+++ b/saleor/product/filters.py
@@ -33,7 +33,7 @@ class ProductFilter(SortedFilterSet):
fields=SORT_BY_FIELDS.keys(),
field_labels=SORT_BY_FIELDS,
)
- price = RangeFilter(label=pgettext_lazy("Currency amount", "Price"))
+ minimal_variant_price = RangeFilter(label=pgettext_lazy("Currency amount", "Price"))
class Meta:
model = Product
diff --git a/templates/product/_filters.html b/templates/product/_filters.html
index f6caa29e23..29ab335f1f 100644
--- a/templates/product/_filters.html
+++ b/templates/product/_filters.html
@@ -12,7 +12,7 @@
This is required if you want to have sorting to be kept during further filtering.
{% endcomment %}
<input type="hidden" name="sort_by" value="{% if request.GET.sort_by %}{{ request.GET.sort_by }}{% endif %}">
- {% elif field.name != 'price' %}
+ {% elif field.name != 'minimal_variant_price' %}
<div class="filter-section" aria-expanded="true">
<div class="filter-section__header">
<h3>{{ field.label }}</h3>
@@ -29,7 +29,7 @@
{% endif %}
{% endfor %}
{% for field in filter_set.form %}
- {% if field.name == 'price' %}
+ {% if field.name == 'minimal_variant_price' %}
<div class="filter-section" aria-expanded="true">
<div class="filter-section__header">
<h3>{{ field.label }}</h3>