@@ -0,0 +1,1162 @@
+from django.db import models%0Afrom django.template.loader import render_to_string%0Afrom django.utils.translation import ugettext_lazy as _%0A%0A%0Aimport plata%0Afrom plata.product.models import Category%0A%0A%0Aclass ProductList(models.Model):%0A    only_featured = models.BooleanField(_('featured only'))%0A    only_sale = models.BooleanField(_('sales only'))%0A    categories = models.ManyToManyField(Category, blank=True, null=True)%0A%0A    class Meta:%0A        abstract = True%0A        verbose_name = _('product list')%0A        verbose_name_plural = _('product lists')%0A%0A    def render(self, request, context, **kwargs):%0A        shop = plata.shop_instance()%0A        products = shop.product_model.objects.active()%0A%0A        if self.only_featured:%0A            products = products.filter(is_featured=True)%0A%0A        categories = %5Bc.pk for c in self.categories.all()%5D%0A        if categories:%0A            products = products.filter(categories__in=categories)%0A%0A        if self.only_sale:%0A            products = %5Bp for p in products if p.in_sale('CHF')%5D%0A%0A        return render_to_string('product/product_list.html', %7B%0A            'object_list': products,%0A            %7D, context_instance=context)%0A

Add ProductList content type for FeinCMS