73 lines
3.4 KiB
Plaintext
73 lines
3.4 KiB
Plaintext
@model ProductSpecificationModel
|
|
|
|
@using Nop.Core.Domain.Catalog;
|
|
@using Nop.Web.Models.Catalog
|
|
|
|
@if (Model.Groups.SelectMany(g => g.Attributes).ToList().Count > 0)
|
|
{
|
|
<div class="product-specs-box">
|
|
<div class="title">
|
|
<strong>@T("Products.Specs")</strong>
|
|
</div>
|
|
<div class="table-wrapper">
|
|
<table class="data-table table table-responsive border-0">
|
|
@* <thead>
|
|
<tr class="hidden-row">
|
|
<th width="25%"><span>@T("Products.Specs.AttributeName")</span></th>
|
|
<th><span>@T("Products.Specs.AttributeValue")</span></th>
|
|
</tr>
|
|
</thead> *@
|
|
<tbody border-0>
|
|
@foreach (var group in Model.Groups)
|
|
{
|
|
@if (group.Attributes.Count > 0)
|
|
{
|
|
@if (group.Id > 0)
|
|
{
|
|
<tr class="spec-header p-3 border-0">
|
|
<td class="spec-group-name p-1 bg-transparent" colspan="2">
|
|
@group.Name
|
|
</td>
|
|
</tr>
|
|
}
|
|
|
|
@for (int i = 0; i < group.Attributes.Count; i++)
|
|
{
|
|
var attr = group.Attributes[i];
|
|
|
|
<tr class="p-3 border-0">
|
|
<td class="spec-name bg-transparent p-1">
|
|
@attr.Name:
|
|
</td>
|
|
<td class="spec-value bg-transparent p-1">
|
|
@for (int j = 0; j < attr.Values.Count; j++)
|
|
{
|
|
var value = attr.Values[j];
|
|
|
|
@if (!string.IsNullOrEmpty(value.ColorSquaresRgb) && (value.AttributeTypeId == (int)SpecificationAttributeType.Option))
|
|
{
|
|
<div class="attribute-squares color-squares attribute-squares-padding">
|
|
<span class="attribute-square-container" title="@Html.Raw(value.ValueRaw)">
|
|
<span class="attribute-square" style="background-color: @(value.ColorSquaresRgb);"> </span>
|
|
</span>
|
|
</div>
|
|
}
|
|
else
|
|
{
|
|
@Html.Raw(value.ValueRaw)
|
|
if (j != attr.Values.Count - 1)
|
|
{
|
|
<text>, </text>
|
|
}
|
|
}
|
|
}
|
|
</td>
|
|
</tr>
|
|
}
|
|
}
|
|
}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
} |