XML & CSV

Overview

The XML & CSV addon allows you easily import products from any XML, CSV, JSON or YML file to your CS-Cart store. Save yourself hours with this add-on and make inventory management hassle free. With the XML Import add-on, your product data will be sent to your store keeping you ahead of your competitors with the newest products. You can be sure the product stock quantities are always up-to-date. The add-on allows you to automatically update product catalogs including changes to prices, inventory stock quantities, and new product additions.

An easy field mapping feature allow you to easily overcome the divergent data formats of suppliers and synchronize only the appropriate data fields to your store.

Important

To import CSV files, please use Open Office or Libre Office Calculator. Microsoft Excel uses Windows-1251 character set while CS-Cart uses UTF-8 character set. There might be an error during the import if you are using MS Excel.

Download an example CSV file.

The add-on also enables you to import XML files with the YML (Yandex Market Language) format. Download an example YML file.

To import a XLSX file, save it as CSV and import the CSV file.

The XML & CSV add-on makes the complicated import tasks simple and fast.

Fields you can import

1. Product fields

  • Product name
  • Product code
  • Price
  • Currency
  • Category
  • External category id
  • External category parent_id
  • External category parent name
  • Secondary categories
  • List price
  • Status
  • Quantity
  • Weight
  • Min quantity
  • Max quantity
  • Quantity step
  • List qty count
  • Shipping freight
  • Date added
  • Downloadable
  • Language
  • Files
  • Ship downloadable
  • Inventory tracking
  • Out of stock actions
  • Free shipping
  • Zero price action
  • Detailed image
  • Additional images
  • Description
  • Short description
  • Meta keywords
  • Meta description
  • Search words
  • Page title
  • Promo text
  • Taxes
  • Available since
  • SEO name
  • Product type
  • Parent product id
  • Variation options
  • Variotion group code
  • Variation set as default

2. Product options

3. Product features

Note

Select Variations as separate products option in the target feature settings in order to import variations correctly. The name of the first product of the group will be repeated for all products of the group, in case the Variations as one product option is selected.

Features

  • Seamlessly import data in the XML, CSV, and YML formats.
  • Quickly upload and sync your product data including new products.
  • Keep up with pricing and inventory changes.
  • Enjoy the fields mapping and category mapping features.
  • Control the fields to be imported with presise setting of the main fields
  • Import products automatically by a cron script.
  • Clone import profiles.
  • Allow/forbid administrators to manage import.
  • Modifi the imported data (using standart Advanced Products Import addon)
  • Import common products for vendors (Common Products for Vendors add-on support)
  • Convert the currency during importing
  • Seamlessly import data in the XML, CSV, JSON and YML formats.

Compatibility

The add-on is compatible with CS-Cart and Multi-Vendor 4.10 and above, but only versions 4.12.x and above are supported. Minimum required PHP version is 7.1.

See more information about compatibility of our add-ons here.

Support

You are guaranteed a quality add-on supported by the future versions. If you need help, please contact us via our help desk system.

Demo

Check out the XML & CSV add-on in our demo store.

Note

Every half an hour the demo store is reset to the default state.

Managing in the admin panel

Installing the add-on

Install the XML & CSV add-on on the add-ons list page (Add-ons → Manage add-ons). Click the + button in the top right corner, select an archive and click Upload & install. You can now find the installed add-on in the list of installed add-ons, just make sure it is set to Active.

Setting up the add-on

  • License key— liecence key of the product.
  • All vendors can import products—If enabled, vendors will be able to import products to the store.
  • Hide Cron tab—When switched on, the tab with the sittings for sceduled import is hidded for vendors.
  • Cron password—Enter a cron password that will be used to set up a cron script.
  • Notify administrator by e-mail when the import is completed—If enabled, the administrator will be notified of the completed import when it is made by cron.
  • Notify vendor by e-mail when the import is completed—If enabled, the vendors will be notified of the completed import when it is made by cron.
  • Imported quantity of products per iteration-Allows to alter the quantity of the products to be imported per iteration.
  • URL for product import—Use this link to run import by cron. For example, you can import the whole catalog every 24 hours and update prices and stock every 5 minutes. See How to set up a cron job in cPanel.

Use the following command:

php /path/to/cart/snikers.php --dispatch=run_import_xml.import --cron_password=MYPASS

where:

path/to/cart is the path to the root store directory

cron_password is the access key to cron script that you should take from the Cron password field.

Importing data

The add-on creates a new XML & CSV profile page, where you can see a list of all created profiles with the ability to delete, edit, add, and import profiles.

You can also see the import status:

  • Open—Means that an import profile has been created, but has not been imported yet.
  • Complete—Means that the import has been completed.
  • In progress—Means that the import is now running.
  • Redirect—Means that the first 1000 products have been imported. To complete import, run the import again.

To import products, follow these steps:

  1. Click the + button to add a new import profile.
  2. In the General tab, enter a name for the import profile and choose the type of the file you are going to import.

Note

If you want to import a file of another type, contact us for help.

Important

To import CSV files, please use Open Office or Libre Office Calculator. Microsoft Excel uses Windows-1251 character set while CS-Cart uses UTF-8 character set. There might be an error during the import if you are using MS Excel.

To import a XLSX file, save it as CSV and import the CSV file.

  1. Click Create.
  2. Switch to the Options tab and configure the following settings:

Display example with selected CSV file type for import:

Select file—Choose location of the XML or CSV file with the import data and select this file.

CSV delimiter—Choose the delimiter in import file

Primary—Choose the primary field of the product. Available options: Product name, Product code, Features

Use additional primary field—Adds the option to choose and use the additional primary product field for importing. When switched on the additional primary field becames required to fill.

Additional primary field—Additional primary product field for product identification Available options: Product name, Product code, Features

Primary fields check method—Two options are available to choose. All: the select is made by the primary and additional fields at once. Cascade: the selection is performed first by the primary field, then by the additional one

Important

Product fields that are meant to define the product from the list are considered to be the primary field in such context. For instance: SKU, GTIN, MPN, EAN, EAP etc.

Language—Select one of the enabled languages in the store.

Category delimiter—Select the delimiter of the category path which is used in the file.

Feature variants delimiter—Select a feature variants delimiter that is used in the file.

Images directory—Directory where images are located. This will be used if an image file is specified without a path. Specify the path to the directory where images are located. This is used if the image file is specified without a path in the file. Alternatively, you can specify the URL to the images directory. (It will be automatically used if the value contains http or https).

Note

.php URLs for images are considered as an incorrect image format and incorrect image extension notice will be displayed on the uploading attempt

Files directory—Specify the path to the directory where product files (for downloadable products) are located. This is used if the File field data is specified without a path in the file.

Reset inventory—Quantity of all products in the store will be reset.

Price decimal separator—Type a decimal separator for product prices that is used in the file.

Option delimiter—Type a separator for option delimiter that is used in the file.

Price margin/discount—Specify a discount or margin in percentage or a fixed amount.

Disable SSl certificate verification—Allows to switch off the SSL-certificate check.

  1. Click Save.
  2. If you are importing a YML file or an XML file with containers, you will see the Containers tab. Otherwise, skip this step.

In the Containers tab, define the following settings:

  • Container of categories—Select the container that consists of product categories in the file to be imported. The drop-down list will have all containers from your file.

Have a look at this example. As you can see, the <categories> container consists of product categories.

  • Container of products—Select the container that consists of products in the file to be imported. The drop-down list will have all containers from your file.

Example:

The <offers> container contains products in this file.

Tip

Usually the containers are the following:

Categories—Product categories

Offers—Products

Offer—Specific product

  1. Click Save again to make further settings appear.
  2. In the Fields mapping tab, arrange a list of fields included in the data feed. Each field has the following attributes:

Field name—Name of the field.

Field type—Meaning of the data in the field.

Modifier—Functions that alter the importing data. Modifiers list button will show all modifiers and the ways of their use. The functionality of the standard Advanced product import add-on is used. Learn more.

Create—Tick the checkboxes next to the fields you want to import for new products.

Update—Tick the checkboxes next to the fields you want to update for existing products.

For YML and XML files with containers, also do the product fields mapping.

  1. In the Category mapping tab, you can match product categories from the import file with product categories in your store. Link categories manually if they were not linked automatically.

You can also quickly link and create multiple categories using the bulk editing feature.

If you need to restart category mapping, activate the “Restart category mapping” checkbox on the “Categories Mapping” tab and click “Save” button:

The categories will be automatically mapped again, during the process of saving the preset.

  1. The Cron tab contains the command that you can run to make import start automatically according to a schedule. You can select one of the preset periods, or define your own.

In order to know how to set up cron, navigate to this section: How to set up a cron job in cPanel.

  1. Save the changes and click the Import button to run import.

The import process may take some time. You will see the result once it’s complete.

Cloning import profiles

The ability to clone import profiles will save you time on setting up profiles with similar settings.

To clone an import profile:

  1. Go to Add-ons > XML & CSV.
  2. Select the profile you want to clone and hover the mouse pointer over it. Click the gear button and select Clone.
  1. The profile will be cloned and you will be redirected to the editing import profile page where you can adjust the import profile the way you need.

Note

The import profile is cloned with the Disabled status.

  1. Click Save.

Common Products add-on Adaptation

The add-on is compatible with the standard add-on Common Products by default.

In order to import products, assigning them common for the marketplace, you need to go through the following steps:

  1. Log in as an administrator of the marketplace
  2. Open the import preset settings
  3. Select All vendors (common products) in the Vendor field on the General settings tab

After that the selection of the importing product to sell will be available for the Vendor’s administrators:

In order to update the common product for particular vendor as an administrator, the product needs to be selected on the General setting tab of the import preset.

By so doing all the products sold by the vendor will be updated.

Important

NOTE! Products won’t be updated, if the vendor doesn’t sell them (Sell this option hasn’t been selected).

Allowing/forbidding administrators to manage import

To allow/forbid administrators/managers to manage import, follow these steps:

  1. Go to Customers > User groups.
  2. Select an existing group or create a new one.
  1. Switch to the Privileges tab and find the Product privileges field.

If select the Full access for this privilege, administrators of this user group will have access to import functionality, i.e. they will be able to view, edit and start import.

If you select Can view only or No access option, administrators of this user group will NOT have access to import functionality, i.e. they will NOT be able to view, edit or start import.

Advanced Import Comparison

Productivity Comparison

Case 1: file №18 from Test-cases article File type: CSV

Modification:

  • the column is added for the first row (client’s file is invalid)

Mapping:

   
Article number Product code
Short description invoice Product name
Short description catalogue Short description
Long description content Description
Advised salesprice Price
Image Detailed image

Case 1.1: the row amount is limited to 300, import via cron

Case 1.2: row amount is limited to 600, import via cron

Case 1.3: row amount is limited up to 1500, import via cron

Case 1.4.: row amount is limited to 4000, import via cron

Results:

Case 2: file №24 from the Test-cases article (“light“ import, without images)

File type: XML

File was not altered

For Advanced Product Import xml target = producten/product

Mapping (for instance, not real mapping):

   
productid Product Code
productnr Product Name
qty Quantity

Case 2.1: 728 products, via console

Case 2.2: 1639 products, via console

Case 2.3: 3060 products, via console

Results:

How to set up a cron job in cPanel

Cron Jobs are used for scheduling tasks to run on the server.

To create a cron job, complete the following steps:

  1. Select Cron Jobs in cPanel.
  1. Fill in the form to create a cron job. Specify when the cron job should be executed. In the Command field, enter the command that will execute the cron script. You can find it in the add-on settings. Do not forget to specify the path to your store.

The cron in the image below will run every day at 11:00PM.

Note

If you have any difficulties with cron setup, please contact your server administrator or contact us for help.

For more details, refer to cPanel Documentation.