From f25f85a6a85e5e8a6fb64e1534d9f9a2c6d882af Mon Sep 17 00:00:00 2001 From: KrzysztofPajak Date: Thu, 14 Oct 2021 15:31:08 +0200 Subject: [PATCH] Add new field ExternalId to the collection entity --- .../Services/ExportImport/ExportManager.cs | 3 ++- .../Services/ExportImport/ImportManager.cs | 3 +++ src/Core/Grand.Domain/Catalog/Collection.cs | 5 +++++ .../Admin/Views/Collection/_CreateOrUpdate.TabInfo.cshtml | 7 +++++++ src/Web/Grand.Web.Admin/Models/Catalog/CollectionModel.cs | 2 ++ src/Web/Grand.Web/App_Data/Resources/DefaultLanguage.xml | 3 +++ 6 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/Business/Grand.Business.System/Services/ExportImport/ExportManager.cs b/src/Business/Grand.Business.System/Services/ExportImport/ExportManager.cs index 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 @@ public virtual byte[] ExportCollectionsToXlsx(IEnumerable collection new PropertyByName("AllowCustomersToSelectPageSize", p => p.AllowCustomersToSelectPageSize), new PropertyByName("PageSizeOptions", p => p.PageSizeOptions), new PropertyByName("Published", p => p.Published), - new PropertyByName("DisplayOrder", p => p.DisplayOrder) + new PropertyByName("DisplayOrder", p => p.DisplayOrder), + new PropertyByName("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.cs index 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 @@ protected virtual void PrepareCollectionMapping(Collection collection, PropertyM case "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.cs index 4813c8e10..c5cdaee77 100644 --- a/src/Core/Grand.Domain/Catalog/Collection.cs +++ b/src/Core/Grand.Domain/Catalog/Collection.cs @@ -127,6 +127,11 @@ public Collection() /// public int DisplayOrder { get; set; } + /// + /// Gets or sets the ExternalId + /// + public string ExternalId { get; set; } + /// /// Gets or sets the date and time of instance creation /// 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.cshtml index 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 @@ +
+ +
+ + +
+
\ No newline at end of file diff --git a/src/Web/Grand.Web.Admin/Models/Catalog/CollectionModel.cs b/src/Web/Grand.Web.Admin/Models/Catalog/CollectionModel.cs index 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 @@ public CollectionModel() [GrandResourceDisplayName("Admin.Catalog.Collections.Fields.DisplayOrder")] public int DisplayOrder { get; set; } + [GrandResourceDisplayName("Admin.Catalog.Collections.Fields.ExternalId")] + public string ExternalId { get; set; } public IList Locales { get; set; } //ACL diff --git a/src/Web/Grand.Web/App_Data/Resources/DefaultLanguage.xml b/src/Web/Grand.Web/App_Data/Resources/DefaultLanguage.xml index 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 @@ Display order + + External identifier + Show featured products on home page