Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@bheyde
Created December 11, 2017 23:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bheyde/0c986a25808c3fe2e6a50b40e1ae7154 to your computer and use it in GitHub Desktop.
Save bheyde/0c986a25808c3fe2e6a50b40e1ae7154 to your computer and use it in GitHub Desktop.
XML Template
<?xml version="1.0" encoding="utf-8"?>
<orders>
<mvt:foreach iterator="order" array="admin_order:orders">
<order>
<!--General Order Information -->
<order_date>&mvte:order:date;</order_date>
<order_id>&mvt:order:id;</order_id>
<order_status>&mvte:order:formatted_status;</order_status>
<batch_id>&mvt:order:batch_id;</batch_id>
<customer_id>&mvt:order:customer_id;</customer_id>
<!-- Bill To Information -->
<bill_fname>&mvte:order:bill_fname;</bill_fname>
<bill_lname>&mvte:order:bill_lname;</bill_lname>
<bill_email>&mvte:order:bill_email;</bill_email>
<bill_phone>&mvte:order:bill_phone;</bill_phone>
<bill_fax>&mvte:order:bill_fax;</bill_fax>
<bill_comp>&mvte:order:bill_comp;</bill_comp>
<bill_addr>&mvte:order:bill_addr;</bill_addr>
<bill_city>&mvte:order:bill_city;</bill_city>
<bill_state>&mvte:order:bill_state;</bill_state>
<bill_zip>&mvte:order:bill_zip;</bill_zip>
<bill_cntry>&mvte:order:bill_cntry;</bill_cntry>
<!-- Ship To Information -->
<ship_fname>&mvte:order:ship_fname;</ship_fname>
<ship_lname>&mvte:order:ship_lname;</ship_lname>
<ship_email>&mvte:order:ship_email;</ship_email>
<ship_phone>&mvte:order:ship_phone;</ship_phone>
<ship_fax>&mvte:order:ship_fax;</ship_fax>
<ship_comp>&mvte:order:ship_comp;</ship_comp>
<ship_addr>&mvte:order:ship_addr;</ship_addr>
<ship_city>&mvte:order:ship_city;</ship_city>
<ship_state>&mvte:order:ship_state;</ship_state>
<ship_zip>&mvte:order:ship_zip;</ship_zip>
<ship_cntry>&mvte:order:ship_cntry;</ship_cntry>
<!-- Product Information-->
<items>
<mvt:foreach iterator="item" array="order:groups">
<item>
<!-- Item Details -->
<line_id>&mvte:item:line_id</line_id>
<sku>&mvt:item:sku;</sku>
<code>&mvte:item:code;</code>
<name>&mvte:item:name;</name>
<base_price>&mvt:item:base_price;</base_price>
<unit_price>&mvt:item:price;</unit_price>
<item_status>&mvte:item:formatted_status</item_status>
<!-- Item Level Discounts -->
<item_discounts>
<mvt:foreach iterator="discount" array="item:discounts">
<discount>
<description>&mvt:discount:descrip;</description>
<amount> &mvt:discount:discount;</amount>
</discount>
</mvt:foreach>
</item_discounts>
<quantity>&mvt:item:quantity;</quantity>
<subtotal>&mvt:item:subtotal;</subtotal>
<!-- Item Options -->
<options>
<mvt:foreach iterator="option" array="item:options">
<option>
<attribute_code>&mvte:option:attr_code;</attribute_code>
<attribute_prompt>&mvte:option:attr_prompt;</attribute_prompt>
<option_code>&mvte:option:opt_code;</option_code>
<option_prompt>&mvt:option:opt_prompt;</option_prompt>
<option_data>&mvt:option:data;&mvt:option:data_long;</option_data>
<option_subtotal>&mvt:option:subtotal;</option_subtotal>
</option>
</mvt:foreach>
</options>
<!-- Option Level Discounts -->
<option_discounts>
<mvt:foreach iterator="discount" array="option:discounts">
<discount>
<description>&mvt:discount:descrip;</description>
<amount> &mvt:discount:discount;</amount>
</discount>
</mvt:foreach>
</option_discounts>
<subscription><mvt:if expr="l.settings:item:subscrp_id">Yes<mvt:else>No</mvt:if></subscription>
<subscription_term>&mvte:item:subscription:productsubscriptionterm:descrip;</subscription_term>
</item>
</mvt:foreach>
</items>
<!-- Coupons -->
<coupons>
<mvt:foreach iterator="coupon" array="order:coupons">
<coupon>
<code>&mvt:coupon:code</code>
<description>&mvt:coupon:descrip;</description>
</coupon>
</mvt:foreach>
</coupons>
<!-- Sales Tax -->
<mvt:foreach iterator="charge" array="order:charges">
<mvt:if expr="l.settings:charge:type EQ 'TAX'">
<tax>&mvt:charge:disp_amt;</tax>
</mvt:if>
</mvt:foreach>
<!-- Shipping Method and Cost-->
<shipping_info>
<mvt:foreach iterator="charge" array="order:charges">
<mvt:if expr="l.settings:charge:type EQ 'SHIPPING'">
<ship_description>&mvte:charge:descrip;</ship_description>
<ship_cost>&mvt:charge:amount;</ship_cost>
</mvt:if>
</mvt:foreach>
<ship_method>&mvte:order:ship_method</ship_method>
</shipping_info>
<charges>
<mvt:foreach iterator="charge" array="order:charges">
<charge>
<charge_type>&mvte:charge:type;</charge_type>
<charge_description>&mvtj:charge:descrip;</charge_description>
<charge_amount>&mvte:charge:amount;"</charge_amount>
</charge>
</mvt:foreach>
</charges>
<!-- Payment Data-->
<payments>
<mvt:foreach iterator="payment" array="order:payments">
<payment>
<payment_type><mvt:if expr="l.settings:payment:type EQ 6">Refund<mvt:else>Payment</mvt:if></payment_type>
<payment_description>&mvt:payment:descrip;</payment_description>
<payment_amount>&mvt:payment:formatted_amount;</payment_amount>
<mvt:foreach iterator="field" array="payment:fields">
<payment_label>&mvt:field:label;</payment_label>
<payment_value>&mvt:field:value;</payment_value>
</mvt:foreach>
</payment>
</mvt:foreach>
</payments>
<!-- Custom Order Fields-->
<mvt:item name="customfields" param="Read_Order( l.settings:order:id, '' )" />
<mvt:foreach iterator="field" array="customfields">
<&mvtj:field:code;>&mvtj:field:value</&mvtj:field:code;>
</mvt:foreach>
<order_total>&mvt:order:total;</order_total>
</order>
</mvt:foreach>
</orders>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment