Forum

The forum is a free service supported by community members. Please consider opening a support ticket if you need timely help.

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 31 Oct 2010 12:59 PM by  Steve L
Multi-product shipping XML
 3 Replies
Sort:
You are not authorized to post a reply.
Author Messages


New Member


Posts:
New Member


--
31 Oct 2010 12:13 AM
    I'm playing with some options for calculating shipping, and based on product attributes we are going to calculate it differently for different products, so I will need to itterate through the product list. But I can't find an example of how the XML looks with a few different products in it, can you provide an example XML?

    thanks.
    0


    Veteran Member


    Posts:2956
    Veteran Member


    --
    31 Oct 2010 03:24 AM
    Hi Rob,

    Quick question. Did you look at the Test Run tab and in that tab, there's a Sample Input text box. It should have the Product xml nodes in there.

    Thanks,
    0


    New Member


    Posts:
    New Member


    --
    31 Oct 2010 04:13 AM
    I did, but it only has one item in the cart it looks like, I was looking for an example with multiple items in it.
    0


    Veteran Member


    Posts:2956
    Veteran Member


    --
    31 Oct 2010 12:59 PM

    Here's one example with 2 order details (products ordered). Remember shipping calculation occurs after user has placed items on checkout so we're using the order detail terminology. I hope the example below helps. One thing to note, the product variant's Extension data (under the ProductVariantExtension node below) is made available to your shipping calculation so you can get creative and pick that value to expand on your calculation. (e.g. a product may have additional surcharge because it's a dangerous for shipping item and you may need to purchase insurance)

    <in>
    <user>
    <userHostAddress>127.0.0.1</userHostAddress>
    <username>host</username>
    <roles>
    <role>Role1</role>
    <role>Role2</role>
    </roles>
    <email>user@address.com</email>
    </user>
    <salesOrder>
    <orderDate>2001-01-01 12:00:00</orderDate>
    <subTotalAmount>34.000</subTotalAmount>
    <shippingCountryCode>US</shippingCountryCode>
    <shippingSubdivisionCode>US-CA</shippingSubdivisionCode>
    <shippingPostalCode>90210</shippingPostalCode>
    <salesOrderDetails>
    <salesOrderDetail>
    <price>10.000</price>
    <quantity>1</quantity>
    <discountAmount>0</discountAmount>
    <weight>10</weight>
    <depth>10</depth>
    <width>20</width>
    <height>30</height>
    <requireShipping>true</requireShipping>
    <productVariantExtension>
    <data>
    <shippingRate>1.00</shippingRate>
    </data>
    </productVariantExtension>
    </salesOrderDetail>
    <salesOrderDetail>
    <price>12.000</price>
    <quantity>2</quantity>
    <discountAmount>0</discountAmount>
    <weight>20</weight>
    <depth>15</depth>
    <width>25</width>
    <height>10</height>
    <requireShipping>true</requireShipping>
    <productVariantExtension />
    </salesOrderDetail>
    </salesOrderDetails>
    </salesOrder>
    </in>


    0
    You are not authorized to post a reply.