Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Change ProductFilter
michal216acc5bce14
diff --git a/saleor/product/filters.py b/saleor/product/filters.pyindex cb05b76573..d1ebbfc5b7 100644--- a/saleor/product/filters.py+++ b/saleor/product/filters.py@@ -13,9 +13,9 @@ class ProductFilter(FilterSet):variant_attributes = set()for product in self.queryset:for attribute in product.product_class.variant_attributes.all():- product_attributes.add(attribute)- for attribute in product.product_class.product_attributes.all():variant_attributes.add(attribute)+ for attribute in product.product_class.product_attributes.all():+ product_attributes.add(attribute)for attribute in product_attributes:self.filters[attribute.slug] = \@@ -46,6 +46,6 @@ class ProductFilter(FilterSet):def get_attribute_choices(attribute):result = [(choice.slug, choice.name)- for choice in AttributeChoiceValue.objects- .filter(attribute__name=attribute.name)]+ for choice in AttributeChoiceValue.objects.filter(+ attribute__slug=attribute.slug)]return resultdiff --git a/templates/category/index.html b/templates/category/index.htmlindex 351a006ee4..eafd7ef79a 100644--- a/templates/category/index.html+++ b/templates/category/index.html@@ -91,6 +91,7 @@<div class="col-md-8 col-lg-9 category-list"><div><!--ProductList-->+ {{ filter.qs.count }}{% for product in filter.qs %}<div class="row">