11 April 2012 at 9:33pm
(Last edited: 11 April 2012 9:48pm),
I´ve made an product catalogue following this tutorial: http://www.ssbits.com/tutorials/2010/dataobjects-as-pages-part-2-using-model-admin-and-url-segments-to-create-a-product-catalogue/
Now I have an Page where all products from all categories are listed. My problem is, I can´t figure out how to sort my products on the CategoryPage by categories and then by the title of the product, so that the products from one category are standing together.
I try to modify the getProductsList-function like this:
public function getProductsList()
return $this->Products(Null, 'Category.Title ASC, Title ASC');
I can´t figure out, how to call the category from the products.
Does anyone have a solution? I hope the problem is clear.
<% control Products.GroupBy(Category) %> and <% control Products.SortBy(Category) %> only returns nothing.
<% control Products.GroupedBy(CategoryPage) %> and <% control Products.GroupedBy(Categories.ID) %> returns only one product.