Profile: Victor

Statistics
Avatar
  • 2

Troubleshooting

In the cycle: foreach (var existingProductTag in existingProductTags)
add

string existingProductTagName = _productTagService.GetProductTagById(existingProductTag).Name;


In the cycle: foreach (string newProductTag in productTags)
correct


//if (existingProductTag.Equals(newProductTag, StringComparison.OrdinalIgnoreCase))
if (existingProductTagName.Equals(newProductTag, StringComparison.OrdinalIgnoreCase))

Sunday, June 17, 2018 6:23 AM

If the goods are first assigned tags, they are saved, but if the product is edited, then the tags are deleted when saving. You open once again for editing the goods, and there in the field "Tags (keywords)": "Enter tags ..."
Reason: error in the code.
File: \Grand.Web\Areas\Admin\Controllers\ProductController.cs
Metod:

protected virtual void SaveProductTags(Product product, string[] productTags)

Line:
if (existingProductTag.Equals(newProductTag, StringComparison.OrdinalIgnoreCase))

This line compares the IDs of the tags associated with the product with the tag names derived from the item edit form.

Sunday, June 17, 2018 6:17 AM