For more details see how the Export Orders for Magento 2 extension works.
Connect your Magento instance to other systems and efficiently export orders to them. Add to export file any order data, fields from 3rd-party extensions, create order export profiles and migrate orders regularly.
bin/magento module:disable Amasty_Orderexport
bin/magento setup:upgrade
.
Amasty Export by now has 3 separate modules to carry out export tasks:
The more Amasty modules you have, the more entities you will be able to export in the fist simplified module and in the PRO version. Follow Import & Export solution updates to discover new possibilities.
Before building export profiles, configure the basic order export options.
Go to Stores → Configuration → Amasty Extensions → Export Orders.
Enable module - select Yes to activate the extension.
Export Batch Size - set the number of orders that will be processed in an iteration.
Log Auto-Cleaning - choose Yes to clean logs automatically. The records will be removed from Export History after the period specified below.
Log Auto-Cleaning Period (Days) - define the period after which export history will be cleaned.
Export Files Auto-Cleaning - if enabled, the generated export files will be automatically removed from the server after the period specified below.
Export Files Auto-Cleaning Period (Days) - identify the period after which the files will be removed from the server.
Enable Multi-Process Export - set to Yes to speed up the export of orders. Remember, that this option is added specifically for orders. The multi-process for Amasty Export and Amasty Export Pro should be enabled in the other tab.
Number of Parallel Processes - specify the number of processes according to your server capabilities. The more parallel processes are set, the faster the export process goes, but the higher the server loads.
Enable Email Alert - choose Yes to notify the recipients when the export fails.
Email Sender - select the contact that will send automatic emails.
Email Recipients - specify to whom the emails will be sent.
Email Template - choose the template for a failure notification.
The extended order export functionality allows you to create flexible profiles for export and execute it on regular basis. To view all the profiles, proceed to System → Export Orders → Profiles.
You can view, delete, add new profiles or run any of them manually right from the grid.
To create a new one, hit the Add New Profile button and follow a profile set up steps.
In the first tab adjust the general information of the profile.
Profile Name - specify the name of the profile for internal usage. This name will be displayed in the grid.
Export Only New Entities - the previously exported orders will be skipped if the setting is enabled. The option is useful in case you export the profile regularly and only newly created orders are needed.
Batch Size - set the number of orders that will be processed in an iteration. You may configure batch size for each profile separately or specify the value in general configuration and use this default value.
You can also automatically execute particular actions when the orders are exported.
Change Processed Orders Status To - specify the status that exported orders will get.
Add Comment to Status History - comment would be added to the order status history after exporting.
Invoice, Ship or Cancel orders after the export if needed. When any of these actions are enabled, you can additionally notify customers.
Proceed to the configuration of output options.
File Name - specify the title for the export file.
Compress Export File With Gzip - enable the toggle to compress the file and save extra space on a server.
Specify where to export the profile: on internal or external server, send the exported file by email or using API.
If Store Exported File On Server is enabled, provide File Path and File Name on Server. The file will be saved in Magento 'var' directory relative to the specified path.
If you want to Upload Exported File By FTP / SFTP, you will need to fill the following fields:
For FTP you can also enable a Passive Mode.
In case you want to Send Exported File to E-mail, provide:
If you are using Send to Rest Api Endpoint, provide:
On the following step, you need to choose the required file type and configure its general settings.
The following formats are available:
For CSV, ODS and XLSX formats you can:
Add Header Row - column titles will be displayed in this row.
Merge Rows into One - data from multiple rows will be merged into one cell if enabled. The character that delimits each field of the child rows is customizable. Check the GIF in a demo to see how it works.
For a CSV file you can additionally set:
For a XML file you can customize:
For JSON specify:
For Template:
Using the Template option, you can build a unqiue file suitable for specific needs. Thanks to the integrated Twig PHP template engine, you can create any template you want to:
In this tab, you can start building your export file by choosing the data to export. The functionality has a tree structure. Thus, you can add any entity, any field within a particular entity, customize prefixes/tags/delimiters and so on to match the requirements of the system you are exporting to.
See how the tree-structures file is built:
Step 1. Add root entities
First, you need to configure the basic order entity and select the fields that will be added to the file on the root level.
Click Add Fields button and choose the relevant data to add to the export file.
Use a search window right in the popup to find the required fields faster. Click Add Selected Fields.
When a field is added, you can customize a column title that will be displayed in the exported file. Moreover, use the Add Static Filed button to create columns that will remain unchanged in the file.
Also, for each file level, you can set a custom entity key, delimiter and a field name. Check how it works:
Step 2. Add subentities
Then you can go down the entity list and enable any you need.
Just hit the Enabled toggle and Add Fileds button. As it was described above, a popup will appear and you will be able to add all required fields concerning a particular entity. For example, for the Order Item entity, you may add product type, sku, price, etc.
The same can be done for the entities with a lower level, such as Order Item Attribute or Order Item Custom Option.
Also, the extension support MSI functionality. You can find the required fields on the Shipment level in the Inventory Source tab.
To include particular product attributes into the export profile, navigate to Stores → Attributes → Product.
For example, we want to add a manufacture attribute. So, we open a particular attribute and proceed to the Order Export tab.
Choose Yes in the Add to Options field and Save the attribute.
Check the result. You will see manufacture attribute in the Fields configuration tab of the export profile (Order Item → Order Item Attribute section).
Also, now you can filter orders by the added product attribute.
In the next tab, you can define which orders should be exported using filtering. For example, you may add only configurable products to the export file. Filtering also has a tree structure and is on the same level as export fields.
Expand the necessary entity, click Add Filter and specify the value you need to export.
Additionally, you can Exclude Parent Entity Row If No Results Found. It means that the parent entity row will be excluded from the export file if the child entity doesn't have filter results relative to the parent entity.
Check how it works:
Set the frequency to run the profile. 2 modes to run a profile are available:
For exporting by cron, you need to set one of the ready-made schedules or create a custom one.
For exporting by event, choose the particular event that will trigger a profile export.
For each profile a separate export history is available. Check the statuses, dates, logs and the exported number of orders. Download a file if necessary.
You may also check the logs for all exported profiles in one place. Navigate to System → Amasty Export → Export History. See the statues and check details to get a full picture.
With the extension, you can link the data generated by 3rd party extensions to the export functionality. All created connections are displayed in the System → Export Orders → 3rd Party Connections tab.
Hit the Add New Connection button to create a new link.
Name - specify the connection title for internal usage.
Table to Join - indicate a table name that needs to be joined.
Parent Entity - choose the entity table to which the foreign table will be joined.
Referenced Table Key - the field from the foreign table, by which the table chosen in 'Table to join' will be joined to the parent entity table.
Base Table Key - specify the field from the parent entity table which will be used for joining with the foreign table.
Save the changes. Now you can add this entity to the export file.
This extension is helpful to perform one-time operations as it has a simplified UI. If you have only Export Orders extension, you will be able to export any order entity, but if you have other export extensions by Amasty, you will easily export any available entity in one place.
Go to System → Amasty Export → Export and select the entity to export.
As soon as you choose the entity, you will be able to configure export details, such as format, title, included fields, etc. Check each configuration details for each tab in the Export Profile Configuration sections.
To configure the basic options for Amasty Export, navigate to Stores → Configuration → Amasty Extensions → Export.
Enable Multi-Process Export - set to Yes to speed up the export.
Number of Parallel Processes - specify the number of processes according to your server capabilities. The more parallel processes are set, the faster the export process goes, but the higher the server loads.
Also, the extension includes Amasty Export Pro features: you can create regular cron jobs to export any available entity.
Go to System → Amasty Export → Cron Jobs.
The more installed Amasty Export extensions you have, the more entities you can export by cron.
Click New Export Job.
Specify the cron job title for internal use and set the schedule for exporting. The file configuration algorithm is the same as described in the Export Profile section.
Export orders are compatible with Amasty Order Attributes extension. Thus, you can find and add custom order fields to the export file.
Also, the extension supports Amasty One Step Checkout so that you could add more order details from your checkout page to the export file.
Find out how to install the Export Orders extension for Magento 2 via Composer.