How to configure an XML Feed
If you select the XML file type at the tab Content Settings, you can create/edit XML schema for your feed.
By default, we provide templates for XML feeds, so you can easily copy and change it according to your requirements.
Usually, Comparison Shopping Engines provide a template of the XML file. Based on this template, you can create your own XML schema.
Typical xml schema:
<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0" xmlns:g="http://base.google.com/ns/1.0">
{% for product in context.products %}
<item>
<attribute_1><![CDATA[{{ product.attribute_1 }}]]></attribute_1>
<attribute_2><![CDATA[{{ product.attribute_2 }}]]></attribute_2>
.....
</item>
{% endfor %}
</rss>
Product cycle block:
{% for product in context.products %}
...
{% endfor %}
Inside this block, you can use any product attribute.
Category cycle block:
{% for category in context.categories %}
...
{% endfor %}
Inside this block, you can use any category attribute.
Review cycle block:
{% for review in context.reviews %}
...
{% endfor %}
Inside this block, you can use any review attribute.
Attribute (pattern) block:
<attribute_1><![CDATA[{{ product.attribute_1 }} ]]></attribute_1>
<attribute_1><![CDATA[{{ category.name }} ]]></attribute_1>
<attribute_1><![CDATA[{{ review.nickname }} ]]></attribute_1>
The attribute code must be enclosed in double curly brackets: {{ product.attribute_code }}. You can use all attribute codes available at Store > Attributes > Product and all static attributes (ex. entity_id, created_at, etc.).
Additionally, you can place any available pattern in curly brackets. [Full pattern list of patterns]
Note
Characters like<
and &
are illegal in XML elements.
<
will generate an error because the parser interprets it as the start of a new element.&
will generate an error because the parser interprets it as the start of a character entity.
We suggest that you enclose all patterns in a CDATA block <attribute><![CDATA[{{ pattern }}]]></attribute>
. In this case, the xml data feed will be valid.