CommerceML Integration

The CommerceML Integration add-on is useful for stores and marketplaces that work with accounting systems. It allows you to:

  • import information about products, inventory levels, and prices from an accounting system into the store;
  • send order information to the accounting system;
  • import changes to those orders from the accounting system (status, products);
  • allow your vendors to do all of the above (if you run a marketplace).

For all this to work, your accounting system must be able to send and receive data in the CommerceML format.

Note

The add-on supports CommerceML schema versions 2.05, 2.07, and 2.10. When receiving data, the add-on automatically detects which version is being used.

How to Set Up Data Exchange Between an Accounting System and Your Store

After you install the add-on:

  • in Store Builder: the system will prompt you to go to Settings → Sync data and select CommerceML Integration:

    Sync data for CommerceML in Store Builder
  • in Multi-Vendor: the system will prompt you to copy the link and share it with your vendors:

    Sync data for CommerceML in Multi-Vendor

A window will open where you can configure the CS-Cart settings for CommerceML integration. In Multi-Vendor, this section is also available to vendors.

The process is divided into three steps. You won’t necessarily need to perform the first two steps more than once; in some cases, only one of them will be required.

Step 1. Configure Your Accounting System

Data exchange is always initiated by your accounting system, not by CS-Cart. Therefore, the first thing you need to do is make sure that CS-Cart can receive files from the accounting system. The connection instructions may differ depending on the accounting system.

Step 1 allows you to:

  • check whether files from the accounting system can reach CS-Cart;
  • let CS-Cart determine what data is contained in the files. This information is required for Step 2.

After you initiate the exchange for the first time and the check completes successfully, a checkmark will appear next to the corresponding item. You will not need to repeat this step afterward.

Important

Although you initiate the exchange in the accounting system, CS-Cart does not create or import anything at this stage. It only analyzes the file. The actual data exchange starts at Step 3.

Step 2. Configure Exchange Rules

After Step 1, CS-Cart will know what your file contains. You can now configure the data exchange rules. They are divided into several tabs:

Configure exchange rules for CommerceML
  • General. This tab contains brief instructions on CommerceML Integration.

  • Catalog. Here you can configure exchange scenarios. For example:

    • whether new products from the accounting system should become immediately visible to customers or initially remain disabled/hidden;
    • whether all new features and categories should be created in the store immediately, or only those that you approve manually should appear;
    • what should happen if a product category or product image is changed in the accounting system;
    • whether CS-Cart should try to automatically match categories (by name) and products (by code) with those that already exist in the store.
  • Products. This tab lets you define more precisely which tasks are handled by your accounting system and which are handled by the store’s Admin panel. Here you can:

    • select which fields from the accounting system should be used for product properties (or whether they should be used at all);
    • define whether these properties should be allowed to differ between the accounting system and CS-Cart. For example, if you want a product to have one name in the accounting system and a different name in the store, you can prevent the store name from being overwritten during each exchange.
  • Orders. Here you decide which orders should be exported to the accounting system and whether changes to those orders should be imported back into the store.

    Note

    To view the orders exported to the accounting system, enter the following URL in your browser: your_domain/commerceml?type=sale&mode=query. For authorization, use the credentials of an administrator who has permission to exchange data via CommerceML.

    The resulting file will also contain custom profile fields added with the Export to CommerceML setting when the fields were created or edited.

  • The Prices, Taxes, Currencies, Categories, and Product features tabs let you map these objects between the accounting system and CS-Cart.

Once you configure the required mappings, CS-Cart will be ready for data exchange. Normally you will not need to repeat this step, but it depends on your configuration. For example, suppose you configure the add-on so that new features are not created in CS-Cart until they have been reviewed. If you then create a new store feature in your accounting system, you will need to manually specify on the Product features tab that this feature should be created in CS-Cart.

Step 3. Run a Complete Data Exchange

Once all the required rules have been configured, you can run the exchange in the accounting system again. This time, the data will be imported into CS-Cart. The same will happen during subsequent exchanges.

At this point, you should configure your accounting system to exchange data with CS-Cart periodically. If there are any problems with the latest exchange, you can view them on the exchange page in CS-Cart.

All key exchange events are recorded in a log stored on the server where your store is hosted. You can retrieve the log for the latest exchange directly from the interface, on the Settings → Sync data page. Other logs are stored in /var/files/[ID]/exim.

To prevent logs from eventually taking up too much disk space, old logs are deleted automatically. You can use the local_conf.php file to specify how many files to store and what the maximum file size should be. Add these two parameters:

$config['commerceml']['max_log_file_size'] = 10240;
$config['commerceml']['max_log_files'] = 10;