Advanced order XML export


  • CSVI Pro 4.5+
  • VirtueMart 2.0.10+

Background information

The advanced order export makes it possible to export XML files with a complex structure that looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<orders xmlns="urn:orders-schema">
            <name>Shipping name</name>
            <contactperson>Shipping name</contactperson>
            <address>Shipping address</address>
            <zip>Shipping zip</zip>
            <city>Shipping city</city>
            <country>Shipping country</country>
            <billtoname>Bill to name</billtoname>
            <billtoaddress>Bill to address></billtoaddress>
            <billtozip>Bill to zip</billtozip>
            <billtocity>Bill to city</billtocity>
            <billtocountry>Bill to country</billtocountry>
            <email>This email address is being protected from spambots. You need JavaScript enabled to view it.</email>
        <orderdescription>Webshop order 25874</orderdescription>
        <note>Deliver it fast</note>
                <description>Wooden hammer</description>
                <description>Power product</description>

These structures are most often used for exporting orders to external sources like a fullfilment company for example.

Preparing the template

The template is the same as any other template except you must setup the layout for CSVI to use for your export. The layout consists of four parts:

  1. Header
  2. Order
  3. Order line
  4. Footer

We are going to use the layout as shown at the intro as example here.


The header is the start of the XML file and contains the opening node for the whole XML file. In our example that is <orders xmlns="urn:orders-schema">.

<?xml version="1.0" encoding="UTF-8"?>
<orders xmlns="urn:orders-schema">


The order part is the complete node of the order and this part is repeated for every order that gets exported. There is a special tag inside the order and is called [orderlines]. This tag will be replaced by the Order line section.

        <orderdescription>Webshop order [order_number]</orderdescription>

Order line

This section contains all the products that belong to the order. This part is repeated as many times as there are products in the order, once all the products are collected the order lines are injected in the Order part where the tag [orderlines] is set.



The footer closes the XML


Exporting the template

To export the order XML it works the same way as a regular order export, once you have assigned the fields to the template and set your options, click on Process to export the orders.