Product XML feed

An XML feed is a structured document that contains data about a particular 'topic'. In this case, we have created the ability for you to define your own XML feed which contains all of the details of products on your store.

You can then provide this feed to any third party service that needs to access your product information (such as a comparison shopping engine).

Some notes:

1) The feed will only update every 24 hours, you can click the 'regenerate feed' button in the top right to regenerate the feed (it may take a few minutes to complete)

2) All the details about a particular product, or product variation, are available

Configuring your XML feed

1. You'll need to install Product XML Feed APP in your account. (Select 'apps' from the left menu and then 'available applications' and click to install the Product XML Feed).

2. Once installed click 'feeds' from the left menu and then 'product feed'.

3. You'll configure the contents of the feed in the text box.

4. The entire product object is available.

5. You should remember to 'close' any {% if %} statements or {% for %} cycles that you code with an {% endif %} or {% endfor %} closing tag.

6. Example content (mimicking the Google product feed) is displayed below.

<?xml version="1.0"?>
<rss xmlns:g="http://base.google.com/ns/1.0" xmlns:c="http://base.google.com/cns/1.0" version="2.0">
    <channel>
        <title>{{ global.business.name }}</title>
        <link>{{ global.business.full_url }}</link>
        <description>{{ global.business.description }}</description>
        {% for product in products %}
            {% if product.archived %}
            {% else %}
            {% set custom_title = product.custom_fields.feed_keyword ? (product.custom_fields.feed_keyword ~ ' ' ~ product.title) : product.title %}
                {% if product.photos|length > 0 %}
                    {% if product.google.has_variations %}
                        {% for variation in product.variations %}
                            {% set description = product.description|striptags %}
                            {% set in_stock = product.google.has_variations ? variation.in_stock : product.in_stock %}
                            {% set weight = product.google.has_variations and variation.weight > 0 ? variation.weight : product.weight %}
                            {% set price_excluding_tax = product.google.has_variations and variation.price_excluding_tax > 0 ? variation.price_excluding_tax : product.price_excluding_tax %}
                            {% set price_including_tax = product.google.has_variations and variation.price_including_tax > 0 ? variation.price_including_tax : product.price_including_tax %}
                            {% set sale_price_excluding_tax = product.google.has_variations and variation.sale_price_excluding_tax > 0 ? variation.sale_price_excluding_tax : product.sale_price_excluding_tax %}
                            {% set sale_price_including_tax = product.google.has_variations and variation.sale_price_including_tax > 0 ? variation.sale_price_including_tax : product.sale_price_including_tax %}
                            {% set price = settings.include_tax ? price_including_tax : price_excluding_tax %}
                            {% set sale_price = settings.include_tax ? sale_price_including_tax : sale_price_excluding_tax %}
                            <item>
                                <link>{{ business.full_url }}{{ product.slug }}</link>
                                <title>{{ (product.title|length > 150 ? (product.title|slice(0, 150) ~ '...') : product.title)|title }}</title>
                                <g:is_bundle>{{ product.google.is_bundle ? 'TRUE' : 'FALSE' }}</g:is_bundle>
                                <g:condition>{{ product.google.condition ? (product.google.condition == 2 ? 'refurbished' : 'used') : 'new' }}</g:condition>
                                <g:availability>in stock</g:availability>
                                <g:price>{{ price|number_format(2, '.', '') }} {{ business.currency }}</g:price>
                                {% if product.google.has_variations %}
                                    <id>{{ product.id }}_{{ loop.index }}</id>
                                {% else %}
                                    <id>{{ product.id }}</id>
                                {% endif %}
                                {% if product.delivery_cost > 0 %}
                                    <g:shipping>
                                        <g:service>Delivery</g:service>
                                        <g:price>{{ (settings.include_tax ? product.delivery_cost_including_tax : product.delivery_cost_excluding_tax)|number_format(2, '.', '') }}</g:price>
                                    </g:shipping>
                                {% elseif product.free_delivery %}
                                    <g:shipping>
                                        <g:service>Free Delivery</g:service>
                                        <g:price>0</g:price>
                                    </g:shipping>
                                {% else %}
                                    {% set shipping_rate = business.best_shipping_rate(sale_price > 0 ? sale_price : price, weight) %}
                                    {% if shipping_rate %}
                                        <g:shipping>
                                            <g:service>{{ shipping_rate.title }}</g:service>
                                            <g:price>{{ (settings.include_tax ? shipping_rate.price_including_tax : shipping_rate.price_excluding_tax)|number_format(2, '.', '') }} {{ business.currency }}</g:price>
                                        </g:shipping>
                                    {% endif %}
                                {% endif %}
                                {% if sale_price > 0 %}
                                    <g:sale_price>{{ sale_price|number_format(2, '.', '') }} {{ business.currency }}</g:sale_price>
                                {% endif %}
                                {% if product.sale and product.sale.to > 0 %}
                                    <g:sale_price_effective_date>{{ product.sale.from|date('Y-m-d\TH:iP') }}/{{ product.sale.to|date('Y-m-d\TH:iP') }}</g:sale_price_effective_date>
                                {% endif %}
                                {% if product.description %}
                                    <description>{{ description|length > 5000 ? (description|slice(0, 5000) ~ '...') : description }}</description>
                                {% endif %}
                                {% for photo in product.photos %}
                                    {% set photo_url = photo.url('', true) %}
                                    {% if loop.index0 == 0 %}
                                        <g:image_link>{{ photo_url }}</g:image_link>
                                    {% else %}
                                        <g:additional_image_link>{{ photo_url }}</g:additional_image_link>
                                    {% endif %}
                                {% endfor %}
                                {% if product.brand_title|length > 0 %}
                                    <g:brand>{{ product.brand_title|length > 70 ? (product.brand_title|slice(0, 70) ~ '...') : product.brand_title }}</g:brand>
                                {% endif %}
                                {% if product.google.no_identifier %}
                                    <g:identifier_exists>FALSE</g:identifier_exists>
                                {% else %}
                                    <g:identifier_exists>{{ product.gtin|length > 0 or product.mpn|length > 0 ? 'TRUE' : 'FALSE' }}</g:identifier_exists>
                                    {% if product.gtin|length > 0 %}
                                        <g:gtin>{{ product.gtin|length > 50 ? (product.gtin|slice(0, 50) ~ '...') : product.gtin }}</g:gtin>
                                    {% endif %}
                                    {% if product.mpn|length > 0 %}
                                        <g:mpn>{{ product.mpn|length > 70 ? (product.mpn|slice(0, 70) ~ '...') : product.mpn }}</g:mpn>
                                    {% endif %}
                                {% endif %}
                                {% if weight > 0 %}
                                    <g:shipping_weight>{{ weight }} {{ business.weight_unit }}</g:shipping_weight>
                                {% endif %}
                                {% if product.google.category_id > 0 %}
                                    <g:google_product_category>{{ product.google.category_id }}</g:google_product_category>
                                {% endif %}
                                {% for name, value in product.google.attributes %}
                                    {% if name == 'color' %}
                                        <g:color>{{ product.google.has_variations ? variation.google_color|default(value) : value }}</g:color>
                                    {% elseif name == 'size' %}
                                        <g:size>{{ product.google.has_variations ? variation.google_size|default(value) : value }}</g:size>
                                    {% else %}
                                        {{ ('<g:' ~ name ~ '>')|raw }}{{ value }}{{ ('</g:' ~ name ~ '>')|raw }}
                                    {% endif %}
                                {% endfor %}
                                {% if product.google.has_variations %}
                                    <g:item_group_id>{{ product.id }}</g:item_group_id>
                                    {% if variation.sku or product.sku %}
                                        <c:sku type="string">{{ variation.sku ? variation.sku : product.sku }}</c:sku>
                                    {% endif %}
                                {% elseif product.sku %}
                                    <c:sku type="string">{{ product.sku }}</c:sku>
                                {% endif %}
                                {% for breadcrumbs in product.breadcrumbs|slice(0, 3) %}
                                    <g:product_type>{% for breadcrumb in breadcrumbs %}{{ loop.first ? '' : ' > ' }}{{ breadcrumb.name }}{% endfor %}</g:product_type>
                                {% endfor %}
                            </item>
                        {% endfor %}
                    {% else %}
                        {% if product.archived %}
                        {% else %}
                            {% set description = product.description|striptags %}
                            {% set in_stock = product.google.has_variations ? variation.in_stock : product.in_stock %}
                            {% set weight = product.google.has_variations and variation.weight > 0 ? variation.weight : product.weight %}
                            {% set price_excluding_tax = product.google.has_variations and variation.price_excluding_tax > 0 ? variation.price_excluding_tax : product.price_excluding_tax %}
                            {% set price_including_tax = product.google.has_variations and variation.price_including_tax > 0 ? variation.price_including_tax : product.price_including_tax %}
                            {% set sale_price_excluding_tax = product.google.has_variations and variation.sale_price_excluding_tax > 0 ? variation.sale_price_excluding_tax : product.sale_price_excluding_tax %}
                            {% set sale_price_including_tax = product.google.has_variations and variation.sale_price_including_tax > 0 ? variation.sale_price_including_tax : product.sale_price_including_tax %}
                            {% set price = settings.include_tax ? price_including_tax : price_excluding_tax %}
                            {% set sale_price = settings.include_tax ? sale_price_including_tax : sale_price_excluding_tax %}
                            <item>
                                <link>{{ business.full_url }}{{ product.slug }}</link>
                                <title>{{ (custom_title|length > 150 ? (custom_title|slice(0, 150) ~ '...') : custom_title)|title }}</title>
                                <g:is_bundle>{{ product.google.is_bundle ? 'TRUE' : 'FALSE' }}</g:is_bundle>
                                <g:condition>{{ product.google.condition ? (product.google.condition == 2 ? 'refurbished' : 'used') : 'new' }}</g:condition>
                                <g:availability>in stock</g:availability>
                                <g:price>{{ price|number_format(2, '.', '') }} {{ business.currency }}</g:price>
                                {% if product.google.has_variations %}
                                    <id>{{ product.id }}_{{ loop.index }}</id>
                                {% else %}
                                    <id>{{ product.id }}</id>
                                {% endif %}
                                {% if product.delivery_cost > 0 %}
                                    <g:shipping>
                                        <g:service>Delivery</g:service>
                                        <g:price>{{ (settings.include_tax ? product.delivery_cost_including_tax : product.delivery_cost_excluding_tax)|number_format(2, '.', '') }}</g:price>
                                    </g:shipping>
                                {% elseif product.free_delivery %}
                                    <g:shipping>
                                        <g:service>Free Delivery</g:service>
                                        <g:price>0</g:price>
                                    </g:shipping>
                                {% else %}
                                    {% set shipping_rate = business.best_shipping_rate(sale_price > 0 ? sale_price : price, weight) %}
                                    {% if shipping_rate %}
                                        <g:shipping>
                                            <g:service>{{ shipping_rate.title }}</g:service>
                                            <g:price>{{ (settings.include_tax ? shipping_rate.price_including_tax : shipping_rate.price_excluding_tax)|number_format(2, '.', '') }} {{ business.currency }}</g:price>
                                        </g:shipping>
                                    {% endif %}
                                {% endif %}
                                {% if sale_price > 0 %}
                                    <g:sale_price>{{ sale_price|number_format(2, '.', '') }} {{ business.currency }}</g:sale_price>
                                {% endif %}
                                {% if product.sale and product.sale.to > 0 %}
                                    <g:sale_price_effective_date>{{ product.sale.from|date('Y-m-d\TH:iP') }}/{{ product.sale.to|date('Y-m-d\TH:iP') }}</g:sale_price_effective_date>
                                {% endif %}
                                {% if product.description %}
                                    <description>{{ description|length > 5000 ? (description|slice(0, 5000) ~ '...') : description }}</description>
                                {% endif %}
                                {% for photo in product.photos %}
                                    {% set photo_url = photo.url('', true) %}
                                    {% if loop.index0 == 0 %}
                                        <g:image_link>{{ photo_url }}</g:image_link>
                                    {% else %}
                                        <g:additional_image_link>{{ photo_url }}</g:additional_image_link>
                                    {% endif %}
                                {% endfor %}
                                {% if product.brand_title|length > 0 %}
                                    <g:brand>{{ product.brand_title|length > 70 ? (product.brand_title|slice(0, 70) ~ '...') : product.brand_title }}</g:brand>
                                {% endif %}
                                {% if product.google.no_identifier %}
                                    <g:identifier_exists>FALSE</g:identifier_exists>
                                {% else %}
                                    <g:identifier_exists>{{ product.gtin|length > 0 or product.mpn|length > 0 ? 'TRUE' : 'FALSE' }}</g:identifier_exists>
                                    {% if product.gtin|length > 0 %}
                                        <g:gtin>{{ product.gtin|length > 50 ? (product.gtin|slice(0, 50) ~ '...') : product.gtin }}</g:gtin>
                                    {% endif %}
                                    {% if product.mpn|length > 0 %}
                                        <g:mpn>{{ product.mpn|length > 70 ? (product.mpn|slice(0, 70) ~ '...') : product.mpn }}</g:mpn>
                                    {% endif %}
                                {% endif %}
                                {% if weight > 0 %}
                                    <g:shipping_weight>{{ weight }} {{ business.weight_unit }}</g:shipping_weight>
                                {% endif %}
                                {% if product.google.category_id > 0 %}
                                    <g:google_product_category>{{ product.google.category_id }}</g:google_product_category>
                                {% endif %}
                                {% for name, value in product.google.attributes %}
                                    {% if name == 'color' %}
                                        <g:color>{{ product.google.has_variations ? variation.google_color|default(value) : value }}</g:color>
                                    {% elseif name == 'size' %}
                                        <g:size>{{ product.google.has_variations ? variation.google_size|default(value) : value }}</g:size>
                                    {% else %}
                                        {{ ('<g:' ~ name ~ '>')|raw }}{{ value }}{{ ('</g:' ~ name ~ '>')|raw }}
                                    {% endif %}
                                {% endfor %}
                                {% if product.google.has_variations %}
                                    <g:item_group_id>{{ product.id }}</g:item_group_id>
                                    {% if variation.sku or product.sku %}
                                        <c:sku type="string">{{ variation.sku ? variation.sku : product.sku }}</c:sku>
                                    {% endif %}
                                {% elseif product.sku %}
                                    <c:sku type="string">{{ product.sku }}</c:sku>
                                {% endif %}
                                {% for breadcrumbs in product.breadcrumbs|slice(0, 3) %}
                                    <g:product_type>{% for breadcrumb in breadcrumbs %}{{ loop.first ? '' : ' > ' }}{{ breadcrumb.name }}{% endfor %}</g:product_type>
                                {% endfor %}
                            </item>
                        {% endif %}
                    {% endif %}
                {% endif %}
            {% endif %}
        {% endfor %}
    </channel>
</rss>

If you need assistance in configuring your XML feed please contact us.

7. To get the URL for your feed select 'feeds' from the left menu and then 'feed urls'. Your feed URL will then be present in the 'product feed' box.