@model ProductDetailsModel @using SmartStore.Core; @using SmartStore.Core.Domain.Common; @using SmartStore.Core.Domain.Orders; @using SmartStore.Core.Domain.Seo; @using SmartStore.Core.Domain.Catalog; @using SmartStore.Core.Domain.Media; @using SmartStore.Core.Infrastructure; @using SmartStore.Core.Events; @using SmartStore.Web.Models.Catalog; @using SmartStore.Web.Framework.UI; @using SmartStore.Web.Framework.Events; @using SmartStore.Web; @{ Layout = "~/Views/Shared/_ColumnsTwo.cshtml"; //title, meta Html.AddTitleParts(!String.IsNullOrEmpty(Model.MetaTitle) ? Model.MetaTitle : Model.Name); Html.AddMetaDescriptionParts(Model.MetaDescription); Html.AddMetaKeywordParts(Model.MetaKeywords); Html.AddScriptParts("~/Scripts/public.product-detail.js"); int pictureSize = EngineContext.Current.Resolve().ProductDetailsPictureSize; var canonicalUrlsEnabled = EngineContext.Current.Resolve().CanonicalUrlsEnabled; if (canonicalUrlsEnabled) { var productUrl = Url.RouteUrl("Product", new { SeName = Model.SeName }, this.Request.Url.Scheme); Html.AddCanonicalUrlParts(productUrl); } }
@Html.Action("ProductBreadcrumb", "Catalog", new { productId = Model.Id })
@Html.Widget("productdetails_top") @using (Html.BeginRouteForm("Product", new { SeName = Model.SeName }, FormMethod.Post, new { id = "product-details-form" })) {
@Html.Widget("productdetails_before_pictures") @Html.Widget("productdetails_after_pictures") @if (Model.Manufacturers.Any(x => x.PictureModel != null)) {
@foreach (var manufacturer in Model.Manufacturers.Where(x => x.PictureModel != null)) { }
} @if (Model.ShowSku) { } @if (Model.Manufacturers.Count > 0) { } @if (Model.ShowManufacturerPartNumber) { } @if (Model.ShowGtin) { } @if (Model.ShowWeight) { } @if (Model.ShowDimensions) { } @if (Model.DisplayBackInStockSubscription) { }
@T("Products.Sku") @Model.Sku
@(Model.Manufacturers.Count == 1 ? T("Products.Manufacturer") : T("Products.Manufacturers")) @for (int i = 0; i < Model.Manufacturers.Count; i++) { var item = Model.Manufacturers[i]; @item.Name if (i != Model.Manufacturers.Count - 1) { , } }
@T("Products.ManufacturerPartNumber") @Model.ManufacturerPartNumber
@T("Products.GTIN") @Model.Gtin
@T("Products.Weight") @Model.Weight
@T("Products.Length") @Model.Length
@T("Products.Width") @Model.Width
@T("Products.Height") @Model.Height
@T("Products.Availability") @Model.StockAvailability
  @Html.Partial("_BackInStockSubscription", Model)
@if (Model.DisplayAdminLink) { @T("Common.Catalog.EditProduct") }

@Model.Name

@Html.Widget("productdetails_overview_top")
@Html.Raw(Model.ShortDescription)
@if (Model.ProductType == ProductType.BundledProduct) {
@Html.Partial("_BundleItemsAddToCart", Model)
} @if (Model.DisplayProductReviews) { @Html.Action("ReviewOverview", new { id = Model.Id }) } @{ if (Model.ProductType == ProductType.BundledProduct) {
@if (Model.RenderBundleTitle()) {

@Model.BundleTitleText

}
@Html.Partial("_BundleItems")
@if (Model.BundledItems.Where(x => x.BundleItem.Visible).Count() == 0) {
@T("Products.NoBundledItems")
}
} else if (Model.ProductVariantAttributes.ShouldBeRendered()) { var dataDictAttributes = new ViewDataDictionary(); dataDictAttributes.TemplateInfo.HtmlFieldPrefix = string.Format("attributes_{0}", Model.Id);
@Html.Partial("_Attributes", Model.ProductVariantAttributes, dataDictAttributes)
} } @{ var dataDictGiftCard = new ViewDataDictionary(); dataDictGiftCard.TemplateInfo.HtmlFieldPrefix = string.Format("giftcard_{0}_0", Model.Id); if (Model.GiftCard.IsGiftCard) {
@Html.Partial("_GiftCardInfo", Model.GiftCard, dataDictGiftCard)
} }
@{ var dataDictAddToCart = new ViewDataDictionary(); dataDictAddToCart.TemplateInfo.HtmlFieldPrefix = string.Format("addtocart_{0}", Model.Id); @Html.Partial("_AddToCart", Model, dataDictAddToCart) }
@Html.Action("ShareButton") @Html.Action("ProductTierPrices", new { productId = Model.Id })
@Html.Widget("productdetails_overview_bottom")
@Html.SmartStore().TabStrip().Name("product-detail-tabs").SmartTabSelection(false).Items(x => { var specificationAttributes = Html.Action("ProductSpecifications", new { productId = Model.Id }).ToString(); var reviews = Html.Action("ProductDetailReviews", new { productId = Model.Id }).ToString(); if (!String.IsNullOrWhiteSpace(Model.FullDescription)) { x.Add().Text(@T("Products.Details")) .Content(Html.Raw("
" + Html.CollapsedText(Model.FullDescription) + "
").ToString()) .Selected(true); } if (!String.IsNullOrWhiteSpace(specificationAttributes)) { x.Add().Text(@T("Products.Specs")) .Content(specificationAttributes) .Selected(String.IsNullOrWhiteSpace(Model.FullDescription)); } if (reviews.HasValue() && Model.DisplayProductReviews) { x.Add().Text(@T("Reviews.ExistingReviews")) .Content(reviews) .Badge(Model.ReviewCount.ToString(), BadgeStyle.Info, Model.ReviewCount > 0) .Selected(String.IsNullOrWhiteSpace(Model.FullDescription) && String.IsNullOrWhiteSpace(specificationAttributes)); } //generate an event EngineContext.Current.Resolve().Publish(new TabStripCreated(x, "product-detail", this.Html, this.Model)); }) @Html.Action("RelatedProducts", new { productId = Model.Id })
@Html.Action("ProductsAlsoPurchased", new { productId = Model.Id })
@Html.Action("ProductTags", new { productId = Model.Id })
} @Html.Widget("productdetails_bottom")