X-Cart:CSV:Notes on exporting

From X-Cart 4 Classic
Jump to: navigation, search

Data exported from an X-Cart store is saved to files with the extension .csv in the directory /xcart/var/tmp, where "/xcart" stands for the store installation directory. The default admin language representation of the data types selected for exporting is normally exported to one CSV file, while the data in other languages (multilanguage data) is exported to separate CSV files (each language in a separate file).

A name for the main export file (the one containing data in the default admin language) is formed according to the scheme "export_YYYYMMDD_HHMMSS.csv", where YYYYMMDD stands for "4-digit year, month, day" and HHMMSS - for "hours, minutes, seconds". Names for multilanguage data export files use a similar format: "export_YYYYMMDD_HHMMSS_XX.csv", where XX stands for a 2-letter language code.

If you use the export option 'Data rows per file' to split the results of exporting into several files so each file would contain a specified number of lines, you might get multiple CSV files with data in the default admin language and multiple CSV files with data in other languages. The file name format for such files is almost the same, with the exception that a numeric index is added to the file name like so: "export_YYYYMMDD_HHMMSS_INDX.csv" or "export_YYYYMMDD_HHMMSS_XX_INDX.csv", where INDX stands for a numeric index.

Images are exported separately to a directory named the same as the name of the main export CSV file. For example, if product information is exported to files named export_20070101_125401.csv and export_20070101_125401_DE.csv, images will be saved to the directory /xcart/var/tmp/export_20070101_125401, where "/xcart" stands for X-Cart installation directory.

As to the formatting of export files, be aware of the following considerations:

  • If, in response to your request to export a certain data type, X-Cart does not find any records of the specified data type in the database, the corresponding section is not printed in the export CSV file.
  • When formatted text pieces (product/category descriptions and language variables) are exported, the newlines contained in them (represented by \n, \r or \r\n sequences) are translated to <EOL> service tags.
  • When you export multilanguage product options and/or multilanguage product option values, the presence in the main export file of the sections [MULTILANGUAGE_PRODUCT_OPTIONS] and [MULTILANGUAGE_PRODUCT_OPTION_VALUES] containing data in the default admin language is explained by the way X-Cart handles product option group and product option value names. The thing is that X-Cart allows product option groups and product option values to have service names in a language that does not have to be the default admin language, while the respective names in the default admin language are treated as multilanguage data. By service names, we understand names used by X-Cart internally to identify product option groups and product option values. These names do not normally appear in the store's user interface, but they may be displayed in the place of the respective names in the default admin language if the names in the default admin language are missing for some reason. Further in this Import/Export Guide, we will refer to the language of the product option group and product option value service names as original. You will notice that, in the chapters describing the CSV format for various types of store data, the fields whose value may be in the original language are marked "original" like this:

!CLASS - Option group name (original)

Please be aware that, although X-Cart allows you to have service names not in the default language, you may prefer not to use this feature. When creating product options by importing, feel free to define the "original" fields using the default admin language, if that is more convenient to you. In this case, you will be able to omit the sections [MULTILANGUAGE_PRODUCT_OPTIONS] and [MULTILANGUAGE_PRODUCT_OPTION_VALUES] from your import file altogether.

  • Similarly to the way X-Cart uses service names for internal identification of product option groups and product option values, it also uses service names for xcart_config table data (Only this time, multilanguage descriptions exist in the form of language variables). Thus, you will find that the !COMMENT field of the [CONFIG] export section contains data in the "original" language.