Table of Contents
- Interface features
- Installing the interface
- Interface settings
- Import orders
- Article attributes
- Transfer of the marketing block
With this interface xentral can be connected to Magento 2 to import orders from there into xentral and to manage the items sold in the store in xentral. The connection is done via an API interface (store importer). The creation and dispatch of delivery bills and invoices is handled via xentral, as is returns management. Updated order statuses, tracking numbers of shipped deliveries, and stock numbers of items are automatically reported back to the store by xentral via process starter.
This module is particularly relevant for anyone who uses or wants to use Magento 2
- Pick up orders from Magento 2
- Change order status on shipment incl. tracking number message
- Transfer articles individually from xentral to Magento or from Magento to xentral
- Reporting of current stock figures in case of stock changes
- Article fields are transferred to Custom Attributes
- Transfer of marketing block
Installing the interface
Create API user in Magento 2
Step 1: Create User In Magento, a new user must be created under System → All Users → Add New User.
Step 2: Fill in account information
Fill in all data
for xentral the fields "User Name" and "New Password" are needed
Enter the password of your user at the bottom and save the changes with "Save User" at the top.
Step 3: Check User Role Under "User Role" the user should be marked as administrator.
Create store interface in xentral
Step 1: Create store interface
Under Administration → Settings → Online Shops → NEW you can search for Magento 2:
Step 2: Enter Magento 2 data
A store name has to be assigned and for now the settings have to be set as shown in the screenshot. Then enter the Magento data into the fields:
Step 3: Check connection
Finally, click on "Check connection" to check whether the connection has worked:
If an error occurs, check whether the access data from Magento has been correctly stored in xentral.
Under the credentials there are a number of settings that are especially relevant for Magento2 stores.
- Automatically export BOM sub-items → If enabled, the sub-items will be exported when a BOM is exported to the store.
- Status "for pickup" → Status of the orders that xentral is to pick up.
- Status "in process" → Status to which orders should be set after pickup to xentral.
- Status "completed" → status to which order will be switched when order has been processed in xentral. By default "completed" if nothing is entered.
- Attribute codes for properties → When importing articles from Magento to xentral, the attributes of the article can be imported directly as properties. For this purpose, however, the attributes to be imported must be specified in this field using the attribute codes from the Magento backend.
- Normal / Reduced Tax ID → If existing tax rates in Magento are to be used when exporting items from xentral to Magento (instead of xentral creating the tax rates 7% or 19%), the IDs of the tax rates from the Magento backend must be entered here.
- Root category ID → When exporting articles or the article tree from xentral to Magento 2, they will be transferred to the root category of Magento2 set here.
- Adjust attribute type on demand → When exporting articles from xentral to Magento, the type of the attribute in Magento can only be adjusted if the attribute is deleted and created again. This process can be caused by this setting.
Other settings and mapping
How to make other settings as well as the payment method and shipping method mapping is explained in the article Online Shops: Settings.
When importing orders, Magento 2 allows you to choose between two pickup modes, pickup by order status or order number.
If the orders are to be picked up from a certain order number, "from number" can be selected and below the order number from which the orders are to be picked up. xentral will then import orders from and including this order.
Magento 2 expects a request to the order ID, not the actual order number, in the pickup mode "from number". It should therefore be noted that the order ID must then be entered, which can be found in the Magento backend in the URL of the order or which appears as the value 1 at the bottom of the log. The also so-called "order ID" in the order overview in the Magento 2 backend corresponds to the value 2 in the log and cannot be recognized here.
However, the value 2 is then entered as the Internet number in the orders, because it also represents the actual order number in the Magento interface.
If orders are to be picked up by order status instead, the designations of the two statuses from Magento can be entered below. xentral then knows which orders are to be picked up with which status and to which status the orders are to be switched in the store once they have been processed.
Import customer comment
The Magento 2 importer can transfer the customer comment in the shopping cart of an order as free text to the order in xentral. If the customer has left several comments, however, only the first comment is transferred, since the order status messages are in the same data structure. Otherwise, there would be a risk that status messages would be interpreted as comments.
When using attributes, the attribute set is always relevant. There are two ways to select the attribute set:
- Store the ID of the attribute at the property with the name 'AttributeSetID'.
- Store the name of the set to be used in the property with the name 'AttributeSetName'.
The attribute set is visible in Magento in the article table:
Mapping in xentral:
If no attribute set is set in the properties, the article will be assigned to the default group by default.
Important: With attribute sets there is always an exception for matrix articles. Here it is the case that the attribute set formed from the matrix properties is prioritized.
Transfer article free fields
The link works via attribute codes. The free fields can be named freely in xentral and are then converted to a valid attribute code by the importer (e.g. color_outside becomes color_outside).
If existing free fields are to be linked between xentral and Magento, the scope or validity range of the attribute in Magento must first be set to Global. This can be set in Magento under Stores → Attributes → Product in the respective attribute. The setting can be found there under Advanced Attribute Properties.
If attributes are newly created in Magento by an export from Xentral, the scope is automatically set to Global. It is important to ensure that the names of the free fields in Xentral are selected in such a way that no unwanted matches occur after the conversion to attribute codes.
In the Attribute Mapping tab, the properties and free fields of an article can be mapped from xentral to attribute types of Magento2. This allows an exact transfer of article properties and free fields to the desired attribute type of Magento.
- Attribute → Here is the attribute code
- Parameter → For Select and Multiselect you can pass a parameter list.
When creating the attributes, the parts are then created as options. Individual values are separated by pipes. It is also possible to mark a parameter as a default option by appending ;1. If nothing, or ;0 are appended to the respective value, the value is marked as not default.
The parameters are only transferred for newly created attributes. It is not possible to append a parameter to an attribute afterwards using this mechanism. If an item is transferred with a property whose value does not yet exist in the attribute's option list, the value is then created as an option by the importer.
If an attribute exists in the store but has a different type than is set in the extended mapping, if the option "Adjust attribute type if needed" is set (see above), the attribute will be deleted from Magento and recreated. Changing the type of the attribute is not possible on the part of Magento. If this option is not set, the attribute type will not be changed.
Without mapping, all attributes are created as type "Text". The mapping refers to the attribute code that xentral transfers. This means that it does not matter whether the attributes are properties or free fields, the attribute code is decisive.
Important: If an attribute is deleted, then also all data to the attribute are deleted! These must be transferred then with all articles again.
Transfer of the marketing block
It is possible in xentral to set the field "Marketing block" by an import. As soon as a customer has indicated that he does not want to receive a "Newsletter", this information can be imported via the button "Import from ...".
To do this, the "manual address transfer" checkbox must be set in the online store interface, otherwise the button will not be displayed in the address.
When reserving items in Magento, there can be problems such as inconsistencies in automatic inventory reconciliation, which have been occurring since the introduction of MSI. That is, since the actual inventory on the product is not cleared until the shipment is created, the inventory level is not consistent from the time the order is placed until it is shipped, even if the updated inventory level is imported in the meantime.
- Regular inventory import: product A has an inventory of 5.
- A customer buys product A; the stock is reserved accordingly: The stock level remains 5, plus there is a reservation, so everything is still correct.
- The order is sent to xentral.
- Regular inventory import: product A has an inventory of 4, because xentral has deducted the inventory in the meantime. The saleable quantity is 4 - 1 = 3 and therefore incorrect or inconsistent.
- The shipment is created in Magento; the reservation is cleared: The saleable quantity is 4 - 0 = 4 and thus correct again.
- Regular inventory import: product A has an inventory of 4 (correct again).
To avoid such inconsistencies, reservations must be disabled in Magento, since xentral is the inventory managing system. There is a plugin from Ampersand for this purpose. This plugin restores the "old" behavior before the introduction of MSI. Thus, no reservations are created, but the stock is deducted directly when the order is received. This prevents inconsistencies when reconciling with xentral.