@processor_for(Category, exact_page=True)
def category_processor(request, page):
 settings.clear_cache()
 products = Product.objects.published(for_user=request.user).filter(page.category.filters()).distinct()
 sort_options = [(slugify(option[0]), option[1]) for option in settings.SHOP_PRODUCT_SORT_OPTIONS]
 sort_by = request.GET.get(u'sort', (sort_options[0][1] if sort_options else u'-date_added'))
 products = paginate(products.order_by(sort_by), request.GET.get(u'page', 1), settings.SHOP_PER_PAGE_CATEGORY, settings.MAX_PAGING_LINKS)
 products.sort_by = sort_by
 sub_categories = page.category.children.published()
 child_categories = Category.objects.filter(id__in=sub_categories)
 return {u'products': products, u'child_categories': child_categories}

@ processor_for ( Category , exact_page = True ) def category_processor ( request , page ) : settings . clear_cache ( ) products = Product . objects . published ( for_user = request . user ) . filter ( page . category . filters ( ) ) . distinct ( ) sort_options = [ ( slugify ( option [ 0 ] ) , option [ 1 ] ) for option in settings . SHOP_PRODUCT_SORT_OPTIONS ] sort_by = request . GET . get ( u'sort' , ( sort_options [ 0 ] [ 1 ] if sort_options else u'-date_added' ) ) products = paginate ( products . order_by ( sort_by ) , request . GET . get ( u'page' , 1 ) , settings . SHOP_PER_PAGE_CATEGORY , settings . MAX_PAGING_LINKS ) products . sort_by = sort_by sub_categories = page . category . children . published ( ) child_categories = Category . objects . filter ( id__in = sub_categories ) return { u'products' : products , u'child_categories' : child_categories }
add paging/sorting to the products for the category .