Skip to content
Permalink
Browse files

Fix - Product tag delete from admin panel is not effected #491

  • Loading branch information...
KrzysztofPajak committed Mar 13, 2019
1 parent 7909211 commit 85f23ce3d804f9f4d29af58f8f2bab7da867d20d
Showing with 4 additions and 3 deletions.
  1. +4 −3 Grand.Web/Areas/Admin/Services/ProductViewModelService.cs
@@ -168,7 +168,7 @@ protected virtual void SaveProductTags(Product product, string[] productTags)

//product tags
var existingProductTags = product.ProductTags.ToList();
var productTagsToRemove = new List<string>();
var productTagsToRemove = new List<ProductTag>();
foreach (var existingProductTag in existingProductTags)
{
var existingProductTagText = _productTagService.GetProductTagByName(existingProductTag.ToLowerInvariant());
@@ -184,12 +184,13 @@ protected virtual void SaveProductTags(Product product, string[] productTags)
}
if (!found)
{
productTagsToRemove.Add(existingProductTag);
productTagsToRemove.Add(existingProductTagText);
}
}
foreach (var productTag in productTagsToRemove)
{
_productService.DeleteProductTag(new ProductTag() { ProductId = product.Id, Id = productTag });
productTag.ProductId = product.Id;
_productService.DeleteProductTag(productTag);
}
foreach (string productTagName in productTags)
{

0 comments on commit 85f23ce

Please sign in to comment.
You can’t perform that action at this time.