1. Kai Diefenbach
  2. django-lfs

Commits

Maciej Wiśniowski  committed 9f6f939

fix product pagination

  • Participants
  • Parent commits 60c58d4
  • Branches default

Comments (0)

Files changed (1)

File lfs/core/templatetags/lfs_tags.py

View file
             products = Product.objects.filter(
                 categories__in=categories,
                 sub_type__in=(STANDARD_PRODUCT, PRODUCT_WITH_VARIANTS, CONFIGURABLE_PRODUCT),
-            ).order_by(sorting)
+            ).distinct().order_by(sorting)
         else:
             products = Product.objects.filter(
                 categories__in=categories,
                 sub_type__in=(STANDARD_PRODUCT, PRODUCT_WITH_VARIANTS, CONFIGURABLE_PRODUCT),
                 active=True,
-            ).order_by(sorting)
+            ).distinct().order_by(sorting)
 
         product_slugs = [p.slug for p in products]
         product_index = product_slugs.index(slug)