Skip to content
PrestaShop · User manual

Import & Export Pro for PrestaShop

Version 0.9.2 Product page
Chapter 7

XML supplier feeds

How to read nested XML supplier feeds with record paths, variants, name/value pairs and category dictionaries, and how to shape XML exports.

Paths instead of columns

An XML feed has no columns. The module turns each repeating product element into a row, and you refer to values by simple paths:

PathReads
titleThe text of the child element <title>.
pricing/amountA nested element.
@skuThe attribute sku of the product element.
features/feature*0The first of several repeated <feature> elements. *1 is the second.

Paths are simple paths, not free XPath. Namespaces are compared by their local name. DTDs and external entities are rejected for security. A single product element can be up to 2 MiB.

Find the record path

  1. Choose XML as File format and upload the file or enter its URL.
  2. Open Supplier feed options and press Discover XML nodes. The module lists the element paths of the document and how many times each appears.
  3. Copy the path of the element that repeats once per product, for example catalog/products/product, into XML record path in Source & destination. It cannot contain an index such as *0.
  4. Press Obtain columns. The paths found inside each product become the available source columns.

An example feed

<catalog>
  <categories>
    <category id="0" parent="">Supplier</category>
    <category id="11" parent="0">Shirts</category>
  </categories>
  <products>
    <product sku="SHIRT">
      <title>Shirt</title><price>1.234,56</price><category_id>11</category_id>
      <features><feature name="Material">Cotton</feature></features>
      <variants>
        <variant sku="SHIRT-M"><stock>2</stock><attribute name="Size">M</attribute></variant>
        <variant sku="SHIRT-L"><stock>3</stock><attribute name="Size">L</attribute></variant>
      </variants>
    </product>
  </products>
</catalog>

The sections below configure this feed step by step.

Variants

When combinations are nested inside the product, enter their path relative to the product in XML variant path (for example variants/variant), here variants/variant. Each variant becomes its own row, carrying the product's values too. In the mapping, refer to variant values with variant/, for example variant/@sku and variant/stock.

Name and value pairs

Features and attributes are often written as repeated elements with a name and a value. Press Add correlated XML pairs to turn them into one column in the Name=Value|Name=Value format that features and combination_attributes expect:

SettingWhat it does
Pair typeProduct pairs are read from the product, Variant pairs from each variant.
Repeated node pathThe repeated element, relative to the product or variant. Here features/feature for product pairs and attribute for variant pairs.
Name path / @attributeWhere the name is. Here @name.
Value path / .Where the value is. . is the element's own text.
Output source columnThe name of the new column, for example feature_pairs or variant_pairs.
Text pair separator (optional)For elements written as Name: Value, the separator, for example :. Only the first occurrence is used.
HTML description column (optional)Creates another column with the complete list as HTML, which a conditional value can append to the description.

Up to 16 pair definitions per profile.

External XML category dictionary

Some feeds give each product only a category ID and list the category tree elsewhere in the document. Open External XML category dictionary and enable Resolve category IDs through another XML node:

SettingExample value
Category record pathcatalog/categories/category
Category ID path@id
Parent ID path@parent
Category name path.
Product category ID columncategory_id
Resolved category path columncategory

The module builds the full path of each product's category, here Supplier > Shirts, in the column you name. Use that column in Category mapping. The dictionary accepts up to 20,000 categories and 128 levels; cycles and missing parents are reported.

Mapping for the example

SourceDestination
@skureference
titlename
priceprice, with Numeric format 1.234,56
variant/@skucombination_reference
variant/stockcombination_quantity
feature_pairsfeatures
variant_pairscombination_attributes

With category mapping on the category column, mapping Supplier > Shirts to one of your categories, this feed produces two combination rows of one product.

XML exports

When you export to XML, these options appear under Supplier feed options:

SettingWhat it does
XML export root nodeThe outer element. Default products. A path such as catalog/products creates nested elements.
XML export record nodeThe element per product or combination. Default product.
Wrap XML text in CDATAWrites text values inside CDATA sections. Some channels require it for descriptions with HTML.

The Destination names in the mapping become element names. They can be nested, such as details/title, or attributes, such as product@id or @sku. Each output path must be unique and use valid XML names.

Still need help?

Open a support ticket from your account and our team will look at your store with you.