Webiant Logo Webiant Logo
  1. No results found.

    Try your search with a different keyword or use * as a wildcard.

ProductTemplate.Simple.cshtml

@model ProductDetailsModel

@using Nop.Core
@using Nop.Core.Domain.Catalog
@using Nop.Core.Domain.Seo
@using Nop.Services.Html

@inject IHtmlFormatter htmlFormatter
@inject IWebHelper webHelper
@inject SeoSettings seoSettings

@{
    Layout = "_ColumnsOne";

    //title
    NopHtml.AddTitleParts(!string.IsNullOrEmpty(Model.MetaTitle) ? Model.MetaTitle : Model.Name);
    //meta
    NopHtml.AddMetaDescriptionParts(Model.MetaDescription);
    NopHtml.AddMetaKeywordParts(Model.MetaKeywords);
    //page class
    NopHtml.AppendPageCssClassParts("html-product-details-page");

    //canonical URL
    if (seoSettings.CanonicalUrlsEnabled)
    {
        var productUrl = Url.RouteUrl(new { SeName = Model.SeName }, webHelper.GetCurrentRequestProtocol()).ToLowerInvariant();
        NopHtml.AddCanonicalUrlParts(productUrl, seoSettings.QueryStringInCanonicalUrlsEnabled);
    }

    //open graph META tags
    if (seoSettings.OpenGraphMetaTags)
    {
        NopHtml.AddHeadCustomParts("");
        NopHtml.AddHeadCustomParts("");
        NopHtml.AddHeadCustomParts("");
        NopHtml.AddHeadCustomParts("");
        NopHtml.AddHeadCustomParts("");
        NopHtml.AddHeadCustomParts("");
        NopHtml.AddHeadCustomParts("");
    }

    //Twitter META tags
    if (seoSettings.TwitterMetaTags)
    {
        NopHtml.AddHeadCustomParts("");
        NopHtml.AddHeadCustomParts("");
        NopHtml.AddHeadCustomParts("");
        NopHtml.AddHeadCustomParts("");
        NopHtml.AddHeadCustomParts("");
        NopHtml.AddHeadCustomParts("");
    }
}

@section Breadcrumb
{
    @await Html.PartialAsync("_ProductBreadcrumb", Model.Breadcrumb)
}
@await Component.InvokeAsync(typeof(WidgetViewComponent), new { widgetZone = PublicWidgetZones.ProductDetailsAfterBreadcrumb, additionalData = Model })
@await Component.InvokeAsync(typeof(WidgetViewComponent), new { widgetZone = PublicWidgetZones.ProductDetailsTop, additionalData = Model })
@if (seoSettings.MicrodataEnabled) { }
@await Component.InvokeAsync(typeof(WidgetViewComponent), new { widgetZone = PublicWidgetZones.ProductDetailsEssentialTop, additionalData = Model })
@await Html.PartialAsync("_Discontinued", Model)

@Model.Name

@if (!string.IsNullOrEmpty(Model.ShortDescription)) {
@Html.Raw(Model.ShortDescription)
} @await Component.InvokeAsync(typeof(WidgetViewComponent), new { widgetZone = PublicWidgetZones.ProductDetailsOverviewTop, additionalData = Model }) @await Html.PartialAsync("_ProductReviewOverview", Model.ProductReviewOverview) @await Html.PartialAsync("_ProductManufacturers", Model.ProductManufacturers) @await Html.PartialAsync("_Availability", Model) @await Html.PartialAsync("_SKU_Man_GTIN_Ven", Model) @await Html.PartialAsync("_DeliveryInfo", Model) @await Html.PartialAsync("_DownloadSample", Model) @{ var dataDictAttributes = new ViewDataDictionary(ViewData); dataDictAttributes.TemplateInfo.HtmlFieldPrefix = $"attributes_{Model.Id}"; @await Html.PartialAsync("_ProductAttributes", Model, dataDictAttributes) } @{ var dataDictGiftCard = new ViewDataDictionary(ViewData); dataDictGiftCard.TemplateInfo.HtmlFieldPrefix = $"giftcard_{Model.Id}"; @await Html.PartialAsync("_GiftCardInfo", Model.GiftCard, dataDictGiftCard) } @{ var dataDictRental = new ViewDataDictionary(ViewData); dataDictRental.TemplateInfo.HtmlFieldPrefix = $"rental_{Model.Id}"; @await Html.PartialAsync("_RentalInfo", Model, dataDictRental) } @{ var dataDictPrice = new ViewDataDictionary(ViewData); dataDictPrice.TemplateInfo.HtmlFieldPrefix = $"price_{Model.Id}"; @await Component.InvokeAsync(typeof(WidgetViewComponent), new { widgetZone = PublicWidgetZones.ProductPriceTop, additionalData = Model }) @await Html.PartialAsync("_ProductPrice", Model.ProductPrice, dataDictPrice) @await Component.InvokeAsync(typeof(WidgetViewComponent), new { widgetZone = PublicWidgetZones.ProductPriceBottom, additionalData = Model }) @await Html.PartialAsync("_ProductTierPrices", Model.TierPrices) var dataDictAddToCart = new ViewDataDictionary(ViewData); dataDictAddToCart.TemplateInfo.HtmlFieldPrefix = $"addtocart_{Model.Id}"; @await Html.PartialAsync("_AddToCart", Model.AddToCart, dataDictAddToCart) @await Html.PartialAsync("_ProductEstimateShipping", Model.ProductEstimateShipping) }
@await Component.InvokeAsync(typeof(WidgetViewComponent), new { widgetZone = PublicWidgetZones.ProductDetailsInsideOverviewButtonsBefore, additionalData = Model }) @{ var dataDictAddToWishlist = new ViewDataDictionary(ViewData); dataDictAddToWishlist.TemplateInfo.HtmlFieldPrefix = $"addtocart_{Model.Id}"; @await Html.PartialAsync("_AddToWishlist", Model.AddToCart, dataDictAddToWishlist) } @await Html.PartialAsync("_CompareProductsButton", Model) @await Html.PartialAsync("_ProductEmailAFriendButton", Model) @await Component.InvokeAsync(typeof(WidgetViewComponent), new { widgetZone = PublicWidgetZones.ProductDetailsInsideOverviewButtonsAfter, additionalData = Model })
@await Html.PartialAsync("_ShareButton", Model) @await Component.InvokeAsync(typeof(WidgetViewComponent), new { widgetZone = PublicWidgetZones.ProductDetailsOverviewBottom, additionalData = Model })
@if (!string.IsNullOrEmpty(Model.FullDescription)) {
@Html.Raw(Model.FullDescription)
} @await Component.InvokeAsync(typeof(WidgetViewComponent), new { widgetZone = PublicWidgetZones.ProductDetailsEssentialBottom, additionalData = Model })
@await Component.InvokeAsync(typeof(WidgetViewComponent), new { widgetZone = PublicWidgetZones.ProductDetailsBeforeCollateral, additionalData = Model })
@await Html.PartialAsync("_ProductSpecifications", Model.ProductSpecificationModel) @await Html.PartialAsync("_ProductTags", Model.ProductTags)
@await Component.InvokeAsync(typeof(ProductsAlsoPurchasedViewComponent), new { productId = Model.Id }) @await Component.InvokeAsync(typeof(RelatedProductsViewComponent), new { productId = Model.Id })
@if (Model.ProductReviewOverview.AllowCustomerReviews) { @await Html.PartialAsync("_ProductReviews", Model.ProductReviews) } @await Component.InvokeAsync(typeof(WidgetViewComponent), new { widgetZone = PublicWidgetZones.ProductDetailsBottom, additionalData = Model })