We have a store setup using ExpressionEngine and Expresso Store, it's all working great however we now need to integrate with another system. This system imports information on orders, it's basically a CRM system, it required an XML file to be produced each time an order is processed, we've managed to produce an XML feed for these orders but unfortunatently it requires a seperate file for EACH order. This is the XML we produced:
<?xml version="1.0" encoding="UTF-8"?>
<Clarity xmlns="http://www.touchsystems.co.uk/schemas" Type="Order" DateTime="2011-04-04T17:58:41.000000" Source="Customer Website">
{exp:store:orders}
<Contact>
<Name>{billing_name}</Name>
<Company></Company>
<Telephone>{billing_phone}</Telephone>
<Email>{order_email}</Email>
<Address>
<Address1>{billing_address1} {billing_address2}</Address1>
<City>{billing_address3}</City>
<County>{billing_region_name}</County>
<Postcode>{billing_postcode}</Postcode>
<Country>United Kingdom</Country>
</Address>
<Detail>
<Title></Title>
<Extension></Extension>
<Fax></Fax>
<Website></Website>
</Detail>
<Comment></Comment>
<Document>
<Title>Online Order REF {order_id}</Title>
<Notes>Here are some example order notes</Notes>
<Detail>
<Terms>Delivery within 30 days of payment</Terms>
<CustOrderNo>{order_id}</CustOrderNo>
<RequiredDate>{order_date}</RequiredDate>
</Detail>
{items}
<Item>
<Partcode>{sku}</Partcode>
<Description>{title} {modifiers}{modifier_name} {modifier_value} {if price_mod_val}({price_mod}){/if}{/modifiers}</Description>
<Quantity>{item_qty}</Quantity>
<UnitPrice>{price} - {item_subtotal}</UnitPrice>
</Item>
{/items}
<Totals>
</Totals>
<DeliveryAddress>
<Contact>{shipping_name}</Contact>
<Address1>{shipping_address1}</Address1>
<Address2>{shipping_address2}</Address2>
<City>{shipping_address3}</City>
<County>{shipping_region_name}</County>
<Postcode>{shipping_postcode}</Postcode>
<Telephone>{shipping_phone}</Telephone>
</DeliveryAddress>
</Document>
</Contact>
{/exp:store:orders}
</Clarity>
But we're not really sure how to go about generating a single XML file per order, will we need to do this with PHP or can ExpressionEngine handle this? Any ideas would be really appreciated!