Posted: July 10, 2019 at 2:41 AM Quote #242332
See https://www.nopcommerce.com/boards/t/70408/createimport-tags-with-commas-in-them.aspx

Problem: Import Tags with Commas in them
i.e. Import Tag String: 1x2;2+3;3/4;5,6,7,8;9xA,10-B

Works and displays corectly in the Frontend
1x2 (1), 2+3 (1) , 3/4 (1), 5,6,7,8 (1) , 9xA,10-B (1)

But does not display correctly in the backend



To fix the problem - need to change the delimiter used

For the import the delimiter is ;

So change the code to be the same - so that the format for the string is consistent

In the code in nop42\Presentation\Nop.Web\Areas\Admin\Views\Product\_CreateOrUpdate.Info.cshtml
Change the delimiter to be ;

    //tags
    $(document).ready(function() {
        @Html.Raw(productTagsSb.ToString())
        $("#@Html.IdFor(model => model.ProductTags)").tagEditor({
            autocomplete: {
                delay: 0,
                position: { collision: 'flip' },
                source: initialProductTags
            },
            delimiter: ';',
            placeholder: '@T("Admin.Catalog.Products.Fields.ProductTags.Placeholder")'
        });
})

In the code nop42\Presentation\Nop.Web\Areas\Admin\Factories\ProductModelFactory.cs

                model.ProductTags = string.Join("; ", _productTagService.GetAllProductTagsByProductId(product.Id).Select(tag => tag.Name));

Replace the  “ ,” with “ ;”
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
www.SelectSystems.com.au
Select Systems International is a computer systems technology solution developer and integration service provider.