Close

Can it be done or added? New Product page multiple JCarousel sliders

[email protected]
12 years ago
#1030 Quote
Avatar
  • 12
I saw that their is a custom data source setting, and am wondering if it is possible to have multiple JCarousel sliders on the New Products page showing new products of several categories?  That way I can keep the site super fast while having a place to show all the new products.
Support
12 years ago
#1032 Quote
Avatar
  • Moderator
  • 1044
Hi,

This is possible what you describe. You can create one jcarousel from the administration and choose for Data source type: custom data source. You can give it a name whatever you want and later you will call the carousel by name - for example "CustomCarousel".

Then all you need to do is to integrate it manually by calling the jcarousel as many times as you wish with different models.

For example if you have 2 categories say Category1 and Category2 you will need to have 2 calls to the jcarousel on the new products page as it follows:

@Html.Action("JCarousel", "JCarousel", new { carouselName = "CustomCarousel", productModels = Model1 })

@Html.Action("JCarousel", "JCarousel", new { carouselName = "CustomCarousel", productModels = Model2 })

where Model1 is list of ProductOverviewModel objects from Category1 and Model2 is list of ProductOverviewModel  objects from Category2.

Hope that helps!

If you need any further assistance please do not hesitate to contact us again.

[email protected]
12 years ago
#1246 Quote
Avatar
  • 12
I am really lossed on this, is it possible to show a step by step?

Support
12 years ago
#1252 Quote
Avatar
  • Moderator
  • 1044
[email protected] wrote:
I am really lossed on this, is it possible to show a step by step?



Hi,

What we have explained above simply illustrates that what you want is possible and assumes that you already have the new products for a given category available in the recently added products view.
Please note that we are not aware of such functionality in nopCommerce to get you the new  products for a given category.
In the RecentlyAddedProducts.cshtml the model is IList<ProductOverviewModel> which contains all the recently added products (new products) from all categories.
So first you need to find a way to get the new products for Category1, Category2 etc. in the view and then use them in the Carousels as described above.

So the most difficult part is to get the new products by a category. To achieve this you need to write some custom code.

Hope this makes things clearer!

Best Regards,
Nop-Templates Support Team