Webiant Logo Webiant Logo
  1. No results found.

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

CompareProducts.cshtml

@model CompareProductsModel

@using Nop.Core.Domain.Catalog

@{
    Layout = "_ColumnsTwo";

    //title
    NopHtml.AddTitleParts(T("PageTitle.CompareProducts").Text);
    //page class
    NopHtml.AppendPageCssClassParts("html-compare-products-page");
}
@{
    var columnWidth = "";
    if (Model.Products.Count > 0)
    {
        columnWidth = Math.Round((decimal)(90M / Model.Products.Count), 0).ToString() + "%";
    }

    var uniqueGroupes = new List();
    foreach (var group in Model.Products.SelectMany(p => p.ProductSpecificationModel.Groups))
    {
        if (!uniqueGroupes.Any(g => g.Id == group.Id))
            uniqueGroupes.Add(group);
    }
}

@T("Products.Compare.Title")

@if (Model.Products.Count > 0) { @T("Products.Compare.Clear")
@foreach (var product in Model.Products) { } @foreach (var product in Model.Products) { var picture = product.PictureModels.FirstOrDefault(); } @foreach (var product in Model.Products) { } @foreach (var product in Model.Products) { } @if (Model.IncludeShortDescriptionInCompareProducts) { @foreach (var product in Model.Products) { } } @if (Model.IncludeFullDescriptionInCompareProducts) { @foreach (var product in Model.Products) { } } @foreach (var group in uniqueGroupes) { if (group.Attributes.Count > 0) { @if (group.Id > 0) { } var uniqueGroupAttributes = new List(); foreach (var attribute in Model.Products.SelectMany(p => p.ProductSpecificationModel.Groups.Where(g => g.Id == group.Id).SelectMany(g => g.Attributes))) { if (!uniqueGroupAttributes.Any(sa => sa.Id == attribute.Id)) uniqueGroupAttributes.Add(attribute); } @foreach (var specificationAttribute in uniqueGroupAttributes) { @foreach (var product in Model.Products) { var foundProductSpec = product.ProductSpecificationModel.Groups .Where(g => g.Id == group.Id) .SelectMany(g => g.Attributes) .FirstOrDefault(sa => sa.Id == specificationAttribute.Id); } } } }
 
  @picture?.AlternateText
@product.Name
@product.ProductPrice.Price
@Html.Raw(product.ShortDescription)
@Html.Raw(product.FullDescription)
@if (foundProductSpec != null) { for (int i = 0; i < foundProductSpec.Values.Count; i++) { var value = foundProductSpec.Values[i]; if (string.IsNullOrEmpty(value.ColorSquaresRgb)) { @Html.Raw(value.ValueRaw) if (i != foundProductSpec.Values.Count - 1) { } } else {
 
} } } else {   }
} else {
@T("Products.Compare.NoItems")
}