Add fields in order export

3 years ago
Hello ,

I want to add a vendor name field and an IBAN number when exporting orders to Excel,
How can I do that?

Thank you ,
3 years ago
It would require customization.  Or, search the marketplace for 'export'; maybe there is a plugin that can do it.
Where is your IBAN Number?  Is that a custom attribute of vendor?  (Even a marketplace plugin may not support that)
3 years ago
msfatima wrote:
Hello ,

I want to add a vendor name field and an IBAN number when exporting orders to Excel,
How can I do that?

Thank you ,


Its not support out of the box. You must need to customize in your site.

PM me if require help from us

Thanks,
Jatin
3 years ago
New York wrote:
It would require customization.  Or, search the marketplace for 'export'; maybe there is a plugin that can do it.
Where is your IBAN Number?  Is that a custom attribute of vendor?  (Even a marketplace plugin may not support that)


IBAN Number yes it's a custom attribute for the vendor .

Yes I know it requires customization but how? Is it in Libraries\Nop.Services\ExportImport ?
3 years ago
msfatima wrote:
... Is it in Libraries\Nop.Services\ExportImport ?


Yes, it is. You must make changes in the ExportOrdersToXlsx method int the ExportManager class.
3 years ago
like that

new PropertyByName<Customer>("VendorId", p => p.VendorId),

Is there is anything else to do ?

Thank you
3 years ago
Yes, you're right, that's all what you need to do
2 months ago
I want ExportOrdersToXlsx contains Product Name.
I'm trying to add a new field "Product Name" to \Nop430\Libraries\Nop.Services\ExportImport\ExportManager.cs

However, I encounter an error.
Here is the screenshot
https://sendfile.cc/uploads/file/202007/0.829328001596252956.png

Can anyone please help?

Thanks
2 months ago
You can not do it that way
There is a setting where it will export the products within the orders in the following format
Order 1
     Product 1
     Product 2
Order 2
     Product 2
     Product 4
Order 3
     Product 1
     Product 3

See Configuration > Setting > Order Settings
yourwebsite/Admin/Setting/Order
Export orders with products - set to true

Otherwise if you just want the product name you would need to loop through each OrderItem and get the Product Name then write the record to excel
See the code that is in
ExportOrdersToXlsx(IList<Order> orders)
and ExportOrderToXlsxWithProducts(...)
2 months ago
Yidna wrote:


See Configuration > Setting > Order Settings
yourwebsite/Admin/Setting/Order
Export orders with products - set to true



Thank you for the reply.
I don't see an export to excel option in Configuration > Setting > Order Settings .
Also, I cannot find "Export orders with products - set to true "
Please advise.

Thanks