Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.
C# aspnet-corecsharpdockerdotnetecommerceecommerce-platformmongodbmulti-storemulti-vendornosqlonline-shopshoppingcart
Add new field ExternalId to the collection entity
KrzysztofPajakf25f85a6a85e
diff --git a/src/Business/Grand.Business.System/Services/ExportImport/ExportManager.cs b/src/Business/Grand.Business.System/Services/ExportImport/ExportManager.csindex 36cf75ea2..bd12e58df 100644--- a/src/Business/Grand.Business.System/Services/ExportImport/ExportManager.cs+++ b/src/Business/Grand.Business.System/Services/ExportImport/ExportManager.cs@@ -102,7 +102,8 @@ namespace Grand.Business.System.Services.ExportImportnew PropertyByName<Collection>("AllowCustomersToSelectPageSize", p => p.AllowCustomersToSelectPageSize),new PropertyByName<Collection>("PageSizeOptions", p => p.PageSizeOptions),new PropertyByName<Collection>("Published", p => p.Published),- new PropertyByName<Collection>("DisplayOrder", p => p.DisplayOrder)+ new PropertyByName<Collection>("DisplayOrder", p => p.DisplayOrder),+ new PropertyByName<Collection>("ExternalId", p => p.ExternalId)};return ExportToXlsx(properties, collections);diff --git a/src/Business/Grand.Business.System/Services/ExportImport/ImportManager.cs b/src/Business/Grand.Business.System/Services/ExportImport/ImportManager.csindex d4d945a62..9a6cde657 100644--- a/src/Business/Grand.Business.System/Services/ExportImport/ImportManager.cs+++ b/src/Business/Grand.Business.System/Services/ExportImport/ImportManager.cs@@ -755,6 +755,9 @@ namespace Grand.Business.System.Services.ExportImportcase "displayorder":collection.DisplayOrder = property.IntValue;break;+ case "externalid":+ collection.ExternalId = property.StringValue;+ break;}}}diff --git a/src/Core/Grand.Domain/Catalog/Collection.cs b/src/Core/Grand.Domain/Catalog/Collection.csindex 4813c8e10..c5cdaee77 100644--- a/src/Core/Grand.Domain/Catalog/Collection.cs+++ b/src/Core/Grand.Domain/Catalog/Collection.cs@@ -127,6 +127,11 @@ namespace Grand.Domain.Catalog/// </summary>public int DisplayOrder { get; set; }+ /// <summary>+ /// Gets or sets the ExternalId+ /// </summary>+ public string ExternalId { get; set; }+/// <summary>/// Gets or sets the date and time of instance creation/// </summary>diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Collection/_CreateOrUpdate.TabInfo.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Collection/_CreateOrUpdate.TabInfo.cshtmlindex ee71fa25b..7fa6f9917 100644--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Collection/_CreateOrUpdate.TabInfo.cshtml+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Collection/_CreateOrUpdate.TabInfo.cshtml@@ -212,6 +212,13 @@<span asp-validation-for="DisplayOrder"></span></div></div>+ <div class="form-group">+ <admin-label asp-for="ExternalId" />+ <div class="col-md-9 col-sm-9">+ <admin-input asp-for="ExternalId" />+ <span asp-validation-for="ExternalId"></span>+ </div>+ </div></div></div><vc:admin-widget widget-zone="collection_details_info_bottom" additional-data="Model" />\ No newline at end of filediff --git a/src/Web/Grand.Web.Admin/Models/Catalog/CollectionModel.cs b/src/Web/Grand.Web.Admin/Models/Catalog/CollectionModel.csindex 8537953d7..a460980f9 100644--- a/src/Web/Grand.Web.Admin/Models/Catalog/CollectionModel.cs+++ b/src/Web/Grand.Web.Admin/Models/Catalog/CollectionModel.cs@@ -83,6 +83,8 @@ namespace Grand.Web.Admin.Models.Catalog[GrandResourceDisplayName("Admin.Catalog.Collections.Fields.DisplayOrder")]public int DisplayOrder { get; set; }+ [GrandResourceDisplayName("Admin.Catalog.Collections.Fields.ExternalId")]+ public string ExternalId { get; set; }public IList<CollectionLocalizedModel> Locales { get; set; }//ACLdiff --git a/src/Web/Grand.Web/App_Data/Resources/DefaultLanguage.xml b/src/Web/Grand.Web/App_Data/Resources/DefaultLanguage.xmlindex 43a279236..c8faefb37 100644--- a/src/Web/Grand.Web/App_Data/Resources/DefaultLanguage.xml+++ b/src/Web/Grand.Web/App_Data/Resources/DefaultLanguage.xml@@ -2409,6 +2409,9 @@<Resource Name="Admin.Catalog.Collections.Fields.DisplayOrder"><Value>Display order</Value></Resource>+ <Resource Name="Admin.Catalog.Collections.Fields.ExternalId">+ <Value>External identifier</Value>+ </Resource><Resource Name="Admin.Catalog.Collections.Fields.FeaturedProductsOnHomePage"><Value>Show featured products on home page</Value></Resource>