Hello Magento Friends,

This tutorial will provide the solution on How to Automatically Generate CSV File on Every Order in Magento 2?

When an order is placed, the store admin needs the order information to fulfill the delivery and shipment process correctly. Generating a CSV file of every order placed helps to get the order information easily.

Here I will explain how to Automatically Generate CSV files on every order in Magento 2. 

Steps to Automatically Generate CSV File on Every Order in Magento 2:

Step 1: Go to the below File Path

app\code\Vendor\Extension\etc\events.xml

Then, add the code as follows

Step 2: Next move to the below File Path

app\code\Vendor\Extension\Observer\GenerateCSV.php

Then add the below code snippet

Step 3: After that run the below command

Output:

You can see a CSV is generated like below for every order placed in your Magento 2 store.

Conclusion:

This way you can Automatically Generate CSV File on Every Order in Magento 2. Generate order report in Magento 2 to manage the shipment and delivery easily.

If you have doubts about the above steps, freely ask me through the comment section. Share the article with your friends and keep in touch with us!

Happy Coding!

Click to rate this post!
[Total: 2 Average: 5]