Hi, i want to edit my specifications tab,
If i want to put two attributes on same specifications i got it like this
But i want to get it like this:
Im using nopCommerce 3.70 version.
Thank you :)
<tbody>
@{
var grps = Model.GroupBy(x=> x.SpecificationAttributeName).ToList();
for (var i = 0; i < grps.Count; i++)
{
var grp = grps[i];
<tr @(i % 2 == 0 ? Html.Raw(" class=\"odd\"") : Html.Raw(" class=\"even\""))>
<td class="spec-name">
@grp.FirstOrDefault().SpecificationAttributeName
</td>
<td class="spec-value">
@if (!string.IsNullOrEmpty(grp.FirstOrDefault().ColorSquaresRgb) && (grp.FirstOrDefault().AttributeTypeId == (int)SpecificationAttributeType.Option))
{
<div class="attribute-squares color-squares">
@foreach (var item in grp)
{
<span class="attribute-square-container" title="@Html.Raw(item.ValueRaw)">
<span class="attribute-square" style="background-color: @(item.ColorSquaresRgb);"> </span>
</span>
}
</div>
}
else
{
@Html.Raw(string.Join(@" / ", grp.Select(x => x.ValueRaw)))
}
</td>
</tr>
}
}
</tbody>
@model IList<ProductSpecificationModel>
@using Nop.Web.Models.Catalog;
@if (Model.Count > 0)
{
<div class="product-specs-box">
<div class="title">
<strong>@T("Products.Specs")</strong>
</div>
<div class="table-wrapper">
<table class="data-table">
<colgroup>
<col width="25%" />
<col />
</colgroup>
<tbody>
@{
var grps = Model.GroupBy(x => x.SpecificationAttributeName).ToList();
for (var i = 0; i < grps.Count; i++)
{
var grp = grps[i];
<tr @(i % 2 == 0 ? Html.Raw(" class=\"odd\"") : Html.Raw(" class=\"even\""))>
<td class="spec-name">
@grp.FirstOrDefault().SpecificationAttributeName
</td>
<td class="spec-value">
@if (!string.IsNullOrEmpty(grp.FirstOrDefault().ColorSquaresRgb) && (grp.FirstOrDefault().AttributeTypeId == (int)SpecificationAttributeType.Option))
{
<div class="attribute-squares color-squares">
@foreach (var item in grp)
{
<span class="attribute-square-container" title="@Html.Raw(item.ValueRaw)">
<span class="attribute-square" style="background-color: @(item.ColorSquaresRgb);"> </span>
</span>
}
</div>
}
else
{
@Html.Raw(string.Join(@" / ", grp.Select(x => x.ValueRaw)))
}
</td>
</tr>
}
}
</tbody>
</table>
</div>
</div>
}
<tbody>
@{
var grps = Model.GroupBy(x => x.SpecificationAttributeName).ToList();
for (var i = 0; i < grps.Count; i++)
{
var grp = grps[i];
<tr @(i % 2 == 0 ? Html.Raw(" class=\"odd\"") : Html.Raw(" class=\"even\""))>
<td class="spec-name">
@grp.FirstOrDefault().SpecificationAttributeName
</td>
<td class="spec-value">
@Html.Raw(string.Join(@" / ", grp.Select(x => x.ValueRaw)))
</td>
</tr>
}
}
</tbody>