hanz wrote:Hi, Thanks for your reply. If I understand well, I need to pass the id's of the products I'd like to show in the JCaroussel to the ProductOverviewModel.
So I tried:
@Html.Action("JCarousel", "JCarousel", new {carouselName = "Winter 2012", productModels = "1667,1668,1669"})
where `Winter 2012` is the caroussel name and the id`s are the product is`s I`d like to show in the caroussel. This gives no errors, but nothing happens.
I also tried like: productModels = 1667,1668,1669 and 1667;1668;1669 etc but receive errors then.
Can you please tell me in detail what to do when I want to show the product id's 1667,1668,1669 in the custom data source caroussel ?
Thanks!
Hi hanz,
The JCarousel custom data source is a source of products and the data for this products should be of type ProductOverviewModel. So it is not enough to pass the id of the product. You have to create a controller that builds and returns a list(IEnumerable) of ProductOverviewModel objects. Then in this controller you can use the IDs of your products to get them and build the list of ProductOverviewModel objects just like it is done in the CatalogController. To create your own controller you need to be familiar with MVC and nopCommerce and use the CatalogController as an example or simply add a new Action to the CatalogController class i.e Winter2012Products and use it to return a view that have IEnumerable<ProductOverviewModel> as a model and then pass this model to the JCarousel as a custom data source.
Hope this is more clear now how the custom data source is intended to be used.
Best Regards,
Nop-Templates Support Team