Skip to content

Commit

Permalink
#VP-1982 Fix: variation properties should not be visible if product i…
Browse files Browse the repository at this point in the history
…s inactive (#410)
  • Loading branch information
kostyrin authored Apr 29, 2020
1 parent f63f2a7 commit 4a26c67
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions VirtoCommerce.Storefront/Domain/Catalog/CatalogConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,13 @@ public static Product ToProduct(this catalogDto.Product productDto, Language cur
.Select(p => ToProperty(p, currentLanguage))
.ToList());

result.VariationProperties = new MutablePagedList<CatalogProperty>(productDto.Properties
.Where(x => string.Equals(x.Type, "Variation", StringComparison.InvariantCultureIgnoreCase))
.Select(p => ToProperty(p, currentLanguage))
.ToList());
if (productDto.IsActive.GetValueOrDefault())
{
result.VariationProperties = new MutablePagedList<CatalogProperty>(productDto.Properties
.Where(x => string.Equals(x.Type, "Variation", StringComparison.InvariantCultureIgnoreCase))
.Select(p => ToProperty(p, currentLanguage))
.ToList());
}
}

if (productDto.Images != null)
Expand Down

0 comments on commit 4a26c67

Please sign in to comment.