Skip to content

Commit

Permalink
Add new field ExternalId to the collection entity
Browse files Browse the repository at this point in the history
  • Loading branch information
KrzysztofPajak committed Oct 14, 2021
1 parent 766bbf5 commit f25f85a
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ public virtual byte[] ExportCollectionsToXlsx(IEnumerable<Collection> collection
new 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions src/Core/Grand.Domain/Catalog/Collection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ public Collection()
/// </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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
2 changes: 2 additions & 0 deletions src/Web/Grand.Web.Admin/Models/Catalog/CollectionModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<CollectionLocalizedModel> Locales { get; set; }

//ACL
Expand Down
3 changes: 3 additions & 0 deletions src/Web/Grand.Web/App_Data/Resources/DefaultLanguage.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit f25f85a

Please sign in to comment.