I would like to present to the user 'Related Products' in ProductDetail display template right above tabs with product description etc. How can I achieve this?
For testing, I am trying something like this, but I am encountering a ‘Null reference exception’.
<div class="rvdsf-field-description-container col-sm-12">
<b>--Insert Showcase here--</b>
@{
var _showCaseViewModel = new ProductShowcaseViewModel();
_showCaseViewModel.Cart = Model.Cart;
_showCaseViewModel.Checkout = Model.Checkout;
_showCaseViewModel.DisplayEffect = ProductShowcaseDisplayEffectType.AutomaticAdvance;
_showCaseViewModel.ProductID = Model.Product.ProductID;
_showCaseViewModel.Products = new List<ProductModel>();
_showCaseViewModel.FrameDuration = 50;
_showCaseViewModel.Height = "100";
_showCaseViewModel.VisibleMaxItems = 3;
_showCaseViewModel.Width = "300";
_showCaseViewModel.WrapFrames = true;
}
@RenderPage("~/DesktopModules/Revindex.Dnn.RevindexStorefront/Portals/_default/Display/ProductShowcase/StandardCarousel/Display.cshtml", _showCaseViewModel)
</div>
<div class="rvdsf-field-description-container col-sm-12">
<ul id="rvdsfProductDetailDescriptionTabs" class="nav nav-tabs hidden-xs d-none d-sm-flex">
Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Revindex.Dnn.RevindexStorefront.Views.ProductShowcaseWebViewPage`1.InitializePage()
--- End of inner exception stack trace ---
at Revindex.Dnn.RevindexStorefront.Views.ProductShowcaseWebViewPage`1.InitializePage()
at System.Web.WebPages.WebPageBase.PushContext(WebPageContext pageContext, TextWriter writer)
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
at System.Web.WebPages.WebPageBase.<>c__DisplayClass40_0.<RenderPageCore>b__0(TextWriter writer)
at System.Web.WebPages.WebPageBase.Write(HelperResult result)
at ASP._Page_DesktopModules_Revindex_Dnn_RevindexStorefront_Portals__default_Display_ProductDetail_Ath2024_Display_cshtml.Execute() in c:\home\site\wwwroot\DesktopModules\Revindex.Dnn.RevindexStorefront\Portals\_default\Display\ProductDetail\Ath2024\Display.cshtml:line 807
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
at DotNetNuke.Web.Razor.RazorEngine.Render(TextWriter writer)