I need a customized xml for orders, like this:
<?xml version="1.0" encoding="UTF-8"?>
<ns1:root xmlns:ns1="https://web.one.com">
<ns1:Orders>
<!-- BEGIN LOOP -->
<ns1:Order ns1:ownCode="{Order ID}">
<ns1:Customer>000000</ns1:Customer>
<ns1:Date>[date("Y-m-d")]</ns1:Date>
<ns1:ServiceDate>{Completed Date}</ns1:ServiceDate>
<ns1:Addressee>
<ns1:Name>{Shipping First Name} {Shipping Last Name}</ns1:Name>
<ns1:Phone>{Shipping Phone}</ns1:Phone>
<ns1:ShippingAddr>
<ns1:Address>{Shipping Address 1} {Shipping Address 2}</ns1:Address>
<ns1:ZipCode>{Shipping Postcode}</ns1:ZipCode>
<ns1:Location>{Shipping City}</ns1:Location>
<ns1:Province>{Shipping State}</ns1:Province>
<ns1:Country>{Shipping Country}</ns1:Country>
</ns1:ShippingAddr>
</ns1:Addressee>
<ns1:Anonymous>"true"</ns1:Anonymous>
<ns1:RemarksLabel>"CompanyLabel"</ns1:RemarksLabel>
<ns1:Lines>
<ns1:Line ownid="{Order Line ID}">
<ns1:Product id="{SKU}">
<ns1:ProductName>{Product Name}</ns1:ProductName>
<ns1:Rate>{Item Cost}</ns1:Rate>
<ns1:SupplierRef>{Product ID}</ns1:SupplierRef>
</ns1:Product>
<ns1:Quantity>{Quantity}</ns1:Quantity>
<ns1:Amount>{Item Total}</ns1:Amount>
</ns1:Line>
</ns1:Lines>
</ns1:Order>
<!-- END LOOP -->
</ns1:Orders>
</ns1:root>
It works for orders, displays all orders from all customers
enter image description here
but gives an error when I add the details of the order lines.
enter image description here
Is something wrong?
Every help is welcome!
the lines should be like this:
<ns1:Lines>
<ns1:Line ns1:ownid="19998">
<ns1:Product ns1:id="1">
<ns1:ProductName>Product A</ns1:ProductName>
<ns1:Rate>10</ns1:Rate>
<ns1:SupplierRef>10000</ns1:SupplierRef>
</ns1:Product>
<ns1:Quantity>1</ns1:Quantity>
<ns1:Amount>10</ns1:Amount>
</ns1:Line>
<ns1:Line ns1:ownid="20000">
<ns1:Product ns1:id="2">
<ns1:ProductName>Product A</ns1:ProductName>
<ns1:Rate>20</ns1:Rate>
<ns1:SupplierRef>30000</ns1:SupplierRef>
</ns1:Product>
<ns1:Quantity>2</ns1:Quantity>
<ns1:Amount>40</ns1:Amount>
</ns1:Line>
</ns1:Lines>