User Tools

Site Tools


Sidebar

magento_2:export_orders

For more details see the Export Orders for Magento 2 extension page.

Guide for Export Orders for Magento 2

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.

  • Build export profiles in 4 various formats
  • Easily find any order entity and add it to the export file
  • Change the names of columns in a file to meet the recipient requirements
  • Execute profiles by schedule, event or manually
  • Use filtering to add only relevant order data to the export file
  • Check extended options with the 2 extra Amasty Export modules

The Export Structure

Amasty Export by now has 3 separate modules to carry out export tasks:

  • Export Orders: a separate export to deal with order entities
  • Amasty Export: suitable for one-time export of any available entity
  • Amasty Export PRO: a tab to create cron jobs concerning export activity

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.

Keep in mind, that if your export managers have specific permissions to the admin panel, you need to grand them access to both Export Orders Profiles and Amasty Export. Otherwise, they won't be able to execute the export.

Export Orders Configuration

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.

The 'Multi-Process Export' feature requires the PHP extension 'pcntl' to be installed on the server. If you enable the feature and no performance boost happens, please ask your hoster/system administrator to check if the 'pcntl' extension is installed.

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.

Export Order Profiles

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.

General Configuration

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.

Actions With Orders After Exporting

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.

Output Options

Proceed to the configuration of output options.

File Name - specify the title for the export file.

Use {date|format} to customize filename. Example: Filename-{date|Y_m_d_h_i_s}. Here you may find more options for date format.

Compress Export File With Gzip - enable the toggle to compress the file and save extra space on a server.

Export File Storage

Specify where to export the profile: on internal or external server, or send the exported file by email.

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:

  • Host
  • User
  • Password
  • File Path
  • File Name for FTP/SFTP.

For FTP you can also enable a Passive Mode.

In case you want to Send Exported File to E-mail, provide:

  • Email Sender
  • E-mail Recipients
  • E-mail Message Subject
  • Email Template.

File Settings

On the following step, you need to choose the required file type and configure its general settings.

The following formats are available:

  • CSV
  • XML
  • ODS
  • XLSX

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:

  • Field Delimiter
  • Field Enclosure Character

For a XML file you can customize:

  • XML Item Tag
  • Header
  • Footer

Fields Configuration

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 custom tags, prefixes and delimiters. 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.

Thus, you can build a unique profile, suitable for a particular system. Check the requirements from a system (as, for example, ERP or B2B invoicing company needs different order data) and match the details.

Export Filters

In the next tab, you can define which orders should be exported using filtering. The values of all entities and fields you've added to the file in a previous step are available for filtering. For example, you may add only configurable products to the export file.

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:

Automatic Export

Set the frequency to run the profile. 2 modes to run a profile are available:

  • by Cron
  • by event

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.

Profile Export History

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.

General Export History

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.

Prefix/Tag Name - an additional name that is placed before the column name.

Save the changes. Now you can add this entity to the export file.

Amasty Export: Fast & Easy

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.

General Settings

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.

The 'Multi-Process Export' feature requires the PHP extension 'pcntl' to be installed on the server. If you enable the feature and no performance boost happens, please ask your hoster/system administrator to check if the 'pcntl' extension is installed.

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.

Amasty Export Pro

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.


Find out how to install the Export Orders extension for Magento 2 via Composer.

Rate the user guide
 stars  from 0 votes (Details)
magento_2/export_orders.txt · Last modified: 2020/09/03 09:40 by tihomirova