I would store the categoryIds the shopper select in a cookie/db table, and in the controller/razor you do a categories.Where(x=> shopperCategoryIdList.Contains(x.Id)).
If you need some more help with the category picker page, or more details on fetching the right categories just ask :)
Here's how I've gotten all products in the selected categories. In my case the user can select multiple categories and then the products are shown together, not grouped. Not exactly what you're asking for, but hope it helps.
Category Filtering
Hi,
I'd like to create a page that shows a list of products grouped by category.
The shopper decides which categories/products are displayed on the page via a check box collection, where each checkbox represents a category.
Basically a single page displaying multiple categories, grouped by category, controlled by the end user via checkboxes.
Can you point me in the right direction?
Thanks.
Hello David
I would store the categoryIds the shopper select in a cookie/db table, and in the controller/razor you do a categories.Where(x=> shopperCategoryIdList.Contains(x.Id)).
If you need some more help with the category picker page, or more details on fetching the right categories just ask :)
Here's how I've gotten all products in the selected categories. In my case the user can select multiple categories and then the products are shown together, not grouped. Not exactly what you're asking for, but hope it helps.
http://pastebin.com/2jUpkRFr
Thank you both for your help. I went with the cookie approach.
Cheers,
David.
is working on a reply...