Skip to content

Commit 9defbb0

Browse files
Minor fix for Google structured data
1 parent acb9eed commit 9defbb0

File tree

1 file changed

+46
-47
lines changed

1 file changed

+46
-47
lines changed

src/Presentation/SmartStore.Web/Views/Product/Partials/Product.Info.cshtml

Lines changed: 46 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -7,60 +7,59 @@
77
}
88

99
<div class="pd-info pd-group">
10-
<!-- Brand -->
11-
@if (brand != null)
12-
{
13-
<div class="pd-brand-block">
14-
<a class="pd-brand" href="@Url.RouteUrl("Manufacturer", new { SeName = brand.SeName })">
15-
@if (brand.Picture != null && brand.Picture.ImageUrl.HasValue() && brand.Picture.PictureId != 0)
10+
@if (Model.Sku.HasValue())
11+
{
12+
<meta itemprop="sku" content="@Model.Sku" />
13+
}
14+
15+
@if (Model.Gtin.HasValue())
16+
{
17+
<meta itemprop="gtin" content="@Model.Gtin" />
18+
}
19+
20+
@if (Model.ManufacturerPartNumber.HasValue())
21+
{
22+
<meta itemprop="mpn" content="@Model.ManufacturerPartNumber" />
23+
}
24+
<!-- Brand -->
25+
@if (brand != null)
26+
{
27+
<div class="pd-brand-block" itemprop="brand">
28+
<a class="pd-brand" href="@Url.RouteUrl("Manufacturer", new { SeName = brand.SeName })">
29+
@if (brand.Picture != null && brand.Picture.ImageUrl.HasValue() && brand.Picture.PictureId != 0)
30+
{
31+
<img class="pd-brand-picture" src="@brand.Picture.ImageUrl" alt="@brand.Picture.AlternateText" title="@brand.Picture.Title" />
32+
}
33+
else
34+
{
35+
<span @Html.LanguageAttributes(brand.Name)>@brand.Name</span>
36+
}
37+
</a>
38+
<meta itemprop="name" content="@brand.Name.Value">
39+
</div>
40+
}
41+
42+
<!-- Title -->
43+
<div class="page-title">
44+
<h1 @Html.LanguageAttributes(Model.Name) class="pd-name" itemprop="name">
45+
@if (Model.IsAssociatedProduct && Model.VisibleIndividually)
1646
{
17-
<img class="pd-brand-picture" src="@brand.Picture.ImageUrl" alt="@brand.Picture.AlternateText" title="@brand.Picture.Title" />
47+
<a href="@Url.RouteUrl("Product", new { SeName = Model.SeName })" title="@T("Products.Details")">@Model.Name</a>
1848
}
1949
else
2050
{
21-
<span @Html.LanguageAttributes(brand.Name)>@brand.Name</span>
51+
@Model.Name
2252
}
23-
</a>
24-
<meta itemprop="brand" content="@brand.Name.Value">
25-
26-
@if (Model.Sku.HasValue())
27-
{
28-
<meta itemprop="sku" content="@Model.Sku" />
29-
}
30-
31-
@if (Model.Gtin.HasValue())
32-
{
33-
<meta itemprop="gtin" content="@Model.Gtin" />
34-
}
35-
36-
@if (Model.ManufacturerPartNumber.HasValue())
37-
{
38-
<meta itemprop="mpn" content="@Model.ManufacturerPartNumber" />
39-
}
53+
</h1>
4054
</div>
41-
}
42-
43-
<!-- Title -->
44-
<div class="page-title">
45-
<h1 @Html.LanguageAttributes(Model.Name) class="pd-name" itemprop="name">
46-
@if (Model.IsAssociatedProduct && Model.VisibleIndividually)
47-
{
48-
<a href="@Url.RouteUrl("Product", new { SeName = Model.SeName })" title="@T("Products.Details")">@Model.Name</a>
49-
}
50-
else
51-
{
52-
@Model.Name
53-
}
54-
</h1>
55-
</div>
5655

57-
<!-- Short description -->
58-
@if (Model.ShortDescription.Value.HasValue())
59-
{
60-
<div @Html.LanguageAttributes(Model.ShortDescription) class="pd-description" itemprop="description">
61-
@Html.Raw(Model.ShortDescription)
62-
</div>
63-
}
56+
<!-- Short description -->
57+
@if (Model.ShortDescription.Value.HasValue())
58+
{
59+
<div @Html.LanguageAttributes(Model.ShortDescription) class="pd-description" itemprop="description">
60+
@Html.Raw(Model.ShortDescription)
61+
</div>
62+
}
6463
</div>
6564

6665
<!-- Review Overview -->

0 commit comments

Comments
 (0)