Hello guys,
Is there a way that I can show my Jcarousel products in category of my choice ?
Hello,
Unfortunately, there is no such functionality in the JCarousel plug-in.
Still, there is something that can be done, but it is not highly recommended:
Lets say you use this widget zone: "
categorydetails_top"
Inside the file(check if it is overridden in the theme folder):
Views/Catalog/CategoryTemplate.ProductsInGridOrLines.cshtmlfind this line:
@Html.Widget("categorydetails_top", Model.Id)
and replace it with these:
@{
var categoryIds = new List<int> { 2, 3, 4 }; // Inside the curly brackets you can list all category IDs, comma separated
if (categoryIds.Contains(Model.Id))
{
@Html.Widget("categorydetails_top", Model.Id)
}
}
Hi, how to achieve this with new version nop4.0? Thanks
Hello
toanhnt,
in order for the code, you already have to work in version 4.0 you need to replace this line of code:
@Html.Widget("categorydetails_top", Model.Id)with this line of code:
@await Component.InvokeAsync("Widget", new { widgetZone = "categorydetails_top", additionalData = Model.Id })Leave the rest the same and everything should work normally.
Thanks, it works great. One last question. How to add 2 widget zones or more with the same method ablove?