Knowledge Base

XML Product feed for Shopify stores


Here is a quick guide on how to set up an Auglio XML product feed for your Shopify store. 

  1. In the Shopify admin, go to Online Store > Themes, and at the Current Theme select the Edit code from the Actions dropdown button. Under the Templates heading, click Add a new template
  2. A form will appear that says "Create a new template for". Select page, set Template type to liquid, File name to Auglio_xml_feed, and click Done
  3. You will now see an item called page.Auglio_xml_feed.liquid listed under Templates. Click on it to edit it, and paste in the code below, replacing all of the existing content for the template
    {% layout none %}<?xml version="1.0" encoding="UTF-8"?>
    <SHOP>
      {% paginate collections.all.products by 2000 %}
    	{% for product in collections.all.products %}	
      {% for variant in product.variants %}	
       <SHOPITEM>
         <GROUP_ID>{{product.id}}</GROUP_ID>
         <ITEM_ID>{{variant.id}}</ITEM_ID>
         <PRODUCTNAME><![CDATA[{{ product.title | strip_html | strip_newlines | escape }}{% if product.variants.size > 1 %} - {{ variant.title | strip_html | strip_newlines | escape }}{% endif %}]]></PRODUCTNAME>
         <DESCRIPTION><![CDATA[{{ product.description | strip_html | strip_newlines }}]]></DESCRIPTION>
         <PRICE>{{product.price | money_without_currency}}</PRICE>
         <IMGURL>{{variant.featured_image | default: product.featured_image | img_url: '400x'}}</IMGURL>
         <URL>{{shop.url}}{{variant.url}}</URL>
         <MANUFACTURER><![CDATA[{{product.vendor | escape }}]]></MANUFACTURER>
         <CATEGORY>category id based on the XML feed specification</CATEGORY>
         <SEX>U</SEX>
         <EAN>{{variant.barcode}}</EAN>
     </SHOPITEM>
    {% endfor %}
    {% endfor %}
    {% endpaginate %}
    </SHOP>
    
  4. Save page.Auglio_xml_feed.liquid and close the code window
  5. Exit the Edit code view
  6. In the Shopify admin, go to Online Store > Pages menu and click Add page. Type Auglio XML Product Feed for the title and leave the content field blank.
  7. On the right side under Theme template, change the template suffix from Default page to Auglio_xml_feed
  8. Click Save

  9. Now in another browser tab, you should be able to view yoursite.com/pages/Auglio-xml-product-feed

Tags:  Product XML feed

Related articles