Nopcommerce: Display friendly enum names when exporting orders

Created on 10 May 2020  路  9Comments  路  Source: nopSolutions/nopCommerce

1) Go to order page, export order into excel
2) Check order status, PaymentStatus, ShippingStatus its showing me id instead of name. its diffucult to find the name based on value.

this issue also exist into oldest version.

1

functionality / feature

All 9 comments

Hi, I can work on that.

Added PR.

Hi, @skoshelev @AndreiMaz did you have chance to review my PR ?

https://github.com/nopSolutions/nopCommerce/pull/4837

Hi @badijm.

I looked at the code you suggested, and I have a couple of comments:

  1. Please do not mix refactoring of old code and task execution, it is better to make it a separate PR
  2. Your code does not take into account the CatalogSettings.ExportImportRelatedEntitiesByName setting
  3. It is better to use a ready-made mechanism using the PropertyByName.DropDownElements properties as it is done in the import / export of products (https://github.com/nopSolutions/nopCommerce/blob/develop/src/Libraries/Nop.Services/ExportImport /ExportManager.cs#L1194)

Okay, I will take a look on the example & update my branch.

@skoshelev Ok, I've just pushed some code changes to my branch.

Hi @badijm. Thank you very much for your contribution, unfortunately, your changes for some reason are not collected in our CI system, in any case, it is better to do everything in one commit since it is very difficult to check a whole series of changes, please make a new PR with a single commit

Ok, sure.

Upd: I've just noticed this new error appeared during unit test running in Travis CI.

@skoshelev

I was almost done with this "migration to single commit", but in the end I struggled with strange issue of OpenXml.

It throws an error only when you export Orders together with Products (ExportOrderToXlsxWithProducts method.),
when _orderSettings.ExportWithProducts is true. (It is true by default )

I'm not sure how proceed with it.

_Message:
System.InvalidOperationException : Validation of E2 failed: Formula1 cannot be empty
Stack Trace:
ExcelDataValidation.Validate()
ExcelDataValidationWithFormula1.Validate() ExcelDataValidationCollection.ValidateAll() ExcelWorkbook.ValidateDataValidations() ExcelWorkbook.Save() ExcelPackage.Save() ExportManager.ExportOrderToXlsxWithProducts(PropertyByName1[] properties, IEnumerable1 itemsToExport) line 685 ExportManager.ExportOrdersToXlsx(IList1 orders) line 1581
ExportManagerTests.CanExportOrdersXlsx() line 186_

success
error

Update: here's I push these changes.

https://github.com/badijm/nopCommerce/commit/a64c7ac66c1cbe5a08520e483488fd7087e74c7b

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mrnams picture mrnams  路  6Comments

AndreiMaz picture AndreiMaz  路  4Comments

mariannk picture mariannk  路  5Comments

tigran-avdalyan picture tigran-avdalyan  路  7Comments

AndreiMaz picture AndreiMaz  路  3Comments