@model IList<ProductOverviewModel>
@await Component.InvokeAsync("JCarousel",new {carouselName = "FULLY EQUIVALENT PRODUCTS", productModels = Model});
And this is CrossReference.cs :
public async Task<IViewComponentResult> InvokeAsync(int productId, int? productThumbPictureSize)
{
//load and cache report
// var productIds = (await _productService.GetRelatedProductsByProductId1Async(productId)).Select(x => x.ProductId2).ToArray();
//load products
string t = "SK_SP-1228ALC180;SK_SP-1239ALC180;SK_SP-1244ALC180";
string[] skus = t.Split(';');
var products = await (await _productService.GetProductsBySkuAsync(skus))
//ACL and store mapping
.WhereAwait(async p => await _aclService.AuthorizeAsync(p) && await _storeMappingService.AuthorizeAsync(p))
//availability dates
.Where(p => _productService.ProductIsAvailable(p))
//visible individually
.Where(p => p.VisibleIndividually).ToListAsync();
if (!products.Any())
return Content(string.Empty);
var model = (await _productModelFactory.PrepareProductOverviewModelsAsync(products, true, true, productThumbPictureSize)).ToList();
return View(model);
}
It runs and returns 3 products in the model.
But I don't see any Jcarousel and have another Jcarousel after this from the pre defined datasource which works fine.
This btw is in the ProductTemplate.Simple.cshtml :
@await Component.InvokeAsync("CrossReference", new { productId = Model.Id })
What am i missing here?