Skip to content

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.

Add new field ExternalId to the brand entity

KrzysztofPajak766bbf50a9c8
diff --git a/src/API/Grand.Api/DTOs/Catalog/BrandDto.cs b/src/API/Grand.Api/DTOs/Catalog/BrandDto.cs
index 7d3fbe83c..b86971242 100644
--- a/src/API/Grand.Api/DTOs/Catalog/BrandDto.cs
+++ b/src/API/Grand.Api/DTOs/Catalog/BrandDto.cs
@@ -20,6 +20,7 @@ namespace Grand.Api.DTOs.Catalog
public bool IncludeInMenu { get; set; }
public string Icon { get; set; }
public bool Published { get; set; }
+ public string ExternalId { get; set; }
public int DisplayOrder { get; set; }
}
}
diff --git a/src/Business/Grand.Business.System/Services/ExportImport/ExportManager.cs b/src/Business/Grand.Business.System/Services/ExportImport/ExportManager.cs
index af0abf882..36cf75ea2 100644
--- a/src/Business/Grand.Business.System/Services/ExportImport/ExportManager.cs
+++ b/src/Business/Grand.Business.System/Services/ExportImport/ExportManager.cs
@@ -74,7 +74,8 @@ namespace Grand.Business.System.Services.ExportImport
new PropertyByName<Brand>("AllowCustomersToSelectPageSize", p => p.AllowCustomersToSelectPageSize),
new PropertyByName<Brand>("PageSizeOptions", p => p.PageSizeOptions),
new PropertyByName<Brand>("Published", p => p.Published),
- new PropertyByName<Brand>("DisplayOrder", p => p.DisplayOrder)
+ new PropertyByName<Brand>("DisplayOrder", p => p.DisplayOrder),
+ new PropertyByName<Brand>("ExternalId", p => p.ExternalId)
};
return ExportToXlsx(properties, brands);
diff --git a/src/Business/Grand.Business.System/Services/ExportImport/ImportManager.cs b/src/Business/Grand.Business.System/Services/ExportImport/ImportManager.cs
index 2fc551875..d4d945a62 100644
--- a/src/Business/Grand.Business.System/Services/ExportImport/ImportManager.cs
+++ b/src/Business/Grand.Business.System/Services/ExportImport/ImportManager.cs
@@ -701,6 +701,9 @@ namespace Grand.Business.System.Services.ExportImport
case "displayorder":
brand.DisplayOrder = property.IntValue;
break;
+ case "externalid":
+ brand.ExternalId = property.StringValue;
+ break;
}
}
}
diff --git a/src/Core/Grand.Domain/Catalog/Brand.cs b/src/Core/Grand.Domain/Catalog/Brand.cs
index 210d2a2d1..f4d707827 100644
--- a/src/Core/Grand.Domain/Catalog/Brand.cs
+++ b/src/Core/Grand.Domain/Catalog/Brand.cs
@@ -112,6 +112,11 @@ namespace Grand.Domain.Catalog
public bool LimitedToStores { get; set; }
public IList<string> Stores { get; set; }
+ /// <summary>
+ /// Gets or sets the ExternalId
+ /// </summary>
+ public string ExternalId { get; set; }
+
/// <summary>
/// Gets or sets a value indicating whether the entity is published
/// </summary>
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Brand/_CreateOrUpdate.TabInfo.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Brand/_CreateOrUpdate.TabInfo.cshtml
index 56b581486..2b53c19a4 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Brand/_CreateOrUpdate.TabInfo.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Brand/_CreateOrUpdate.TabInfo.cshtml
@@ -201,6 +201,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="brand_details_info_bottom" additional-data="Model" />
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Models/Catalog/BrandModel.cs b/src/Web/Grand.Web.Admin/Models/Catalog/BrandModel.cs
index 67fd3b5af..5a63a136e 100644
--- a/src/Web/Grand.Web.Admin/Models/Catalog/BrandModel.cs
+++ b/src/Web/Grand.Web.Admin/Models/Catalog/BrandModel.cs
@@ -24,15 +24,12 @@ namespace Grand.Web.Admin.Models.Catalog
}
[GrandResourceDisplayName("Admin.Catalog.Brands.Fields.Name")]
-
public string Name { get; set; }
[GrandResourceDisplayName("Admin.Catalog.Brands.Fields.Description")]
-
public string Description { get; set; }
[GrandResourceDisplayName("Admin.Catalog.Brands.Fields.BottomDescription")]
-
public string BottomDescription { get; set; }
[GrandResourceDisplayName("Admin.Catalog.Brands.Fields.BrandLayout")]
@@ -40,7 +37,6 @@ namespace Grand.Web.Admin.Models.Catalog
public IList<SelectListItem> AvailableBrandLayouts { get; set; }
[GrandResourceDisplayName("Admin.Catalog.Brands.Fields.MetaKeywords")]
-
public string MetaKeywords { get; set; }
[GrandResourceDisplayName("Admin.Catalog.Brands.Fields.MetaDescription")]
@@ -84,6 +80,9 @@ namespace Grand.Web.Admin.Models.Catalog
[GrandResourceDisplayName("Admin.Catalog.Brands.Fields.DisplayOrder")]
public int DisplayOrder { get; set; }
+ [GrandResourceDisplayName("Admin.Catalog.Brands.Fields.ExternalId")]
+ public string ExternalId { get; set; }
+
public IList<BrandLocalizedModel> Locales { get; set; }
//ACL
@@ -143,5 +142,6 @@ namespace Grand.Web.Admin.Models.Catalog
[GrandResourceDisplayName("Admin.Catalog.Brands.Fields.SeName")]
public string SeName { get; set; }
+
}
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/App_Data/Resources/DefaultLanguage.xml b/src/Web/Grand.Web/App_Data/Resources/DefaultLanguage.xml
index dfac5cf64..43a279236 100644
--- a/src/Web/Grand.Web/App_Data/Resources/DefaultLanguage.xml
+++ b/src/Web/Grand.Web/App_Data/Resources/DefaultLanguage.xml
@@ -2013,6 +2013,9 @@
<Resource Name="Admin.Catalog.Brands.Fields.DisplayOrder">
<Value>Display order</Value>
</Resource>
+ <Resource Name="Admin.Catalog.Brands.Fields.ExternalId">
+ <Value>External identifier</Value>
+ </Resource>
<Resource Name="Admin.Catalog.Brands.Fields.Icon">
<Value>Icon</Value>
</Resource>