Forum

The forum is a free service supported by community members. Please consider opening a support ticket if you need timely help.

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 20 Mar 2024 02:36 PM by  Steve L
ProductShowcase inside of ProductDetail
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages


New Member


Posts:47
New Member


--
19 Mar 2024 08:23 AM

    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)

    Attachments
    0


    Veteran Member


    Posts:2955
    Veteran Member


    --
    20 Mar 2024 02:36 PM

    Hi Kamil

    You cannot just add the ProductShowcaseViewModel inside the ProductDetail template. The engine behind will not recognize it. Currently, the only way is to add the ProductShowcase module to the page and then use some Javascript to reposition the content to where you want it to appear in the page. If you need help, you may engage us to do the work for you.

    Thank you

    0
    You are not authorized to post a reply.