Skip to content

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

Filter products by product type

Anna Siwik7823081271cb
diff --git a/saleor/dashboard/product/filters.py b/saleor/dashboard/product/filters.py
index 962042d9b6..904da55846 100644
--- a/saleor/dashboard/product/filters.py
+++ b/saleor/dashboard/product/filters.py
@@ -39,6 +39,10 @@ class ProductFilter(SortedFilterSet):
label=pgettext_lazy('Product list filter label', 'Categories'),
name='categories',
queryset=Category.objects.all())
+ product_class = ModelMultipleChoiceFilter(
+ label=pgettext_lazy('Product list filter label', 'Product type'),
+ name='product_class',
+ queryset=ProductClass.objects.all())
price = RangeFilter(
label=pgettext_lazy('Product list filter label', 'Price'),
name='price',
diff --git a/tests/dashboard/test_chips.py b/tests/dashboard/test_chips.py
index ffe6906e20..dbe1c2858b 100644
--- a/tests/dashboard/test_chips.py
+++ b/tests/dashboard/test_chips.py
@@ -7,7 +7,6 @@ from saleor.dashboard.templatetags.chips import (
CHIPS_PATTERN, handle_default, handle_single_choice,
handle_multiple_choice, handle_nullboolean, handle_single_model_choice,
handle_multiple_model_choice, handle_range)
-from saleor.dashboard.product.filters import ProductFilter
from saleor.dashboard.widgets import PriceRangeWidget
from saleor.product.models import Category, Product