ecommAddOrder_order

Oct 8, 2010 at 2:48 PM

Hi All,

Has anyone worked with "ecommAddOrder_order". Can I get an example of it please

 

thank you all in advance


Oct 8, 2010 at 3:56 PM

What didn't you got from my last images???

It's so simple...

 

 

    campaignEcommAddOrderInput input = new campaignEcommAddOrderInput();

    // **** access, output, and validate
    input.api_AccessType = PerceptiveMCAPI.EnumValues.AccessType.XmlRpc;
    input.api_OutputType = PerceptiveMCAPI.EnumValues.OutputType.JSON;

    // -------------------------------------- 
    // order object
    campaignEcommAddOrder_order order = new campaignEcommAddOrder_order();
    order.order_id = "...";
    order.campaign_id = "...";
    order.email_id = "...";
    order.email = "...";
    order.total = 0.0;
    order.order_date = DateTime.Now;    // optional
    order.shipping = 0.0;               // optional value
    order.tax = 0.0;                    // optional value
    order.store_id = "...";
    order.store_name = "...";           // optional value
    order.plugin_id = "...";            // register Plugin as docs mention

    // -------------------------------------- 
    // order items
    List<ecommOrder_item> orderItems = new List<ecommOrder_item>();

    foreach(myOrderItem in myOrder)
        orderItems.Add(
            new ecommOrder_item() {
                line_num = 0,
                product_id = 0,
                product_name = "...",
                category_id = 0,
                category_name = "...",
                qty = 0,
                cost = 0.0
            });

    order.items = orderItems;

    // -------------------------------------- 
    // input parms
    input.parms.apikey = "cid-value";
    input.parms.order = order;

    // --------------------------------------
    // execution
    campaignEcommAddOrder cmd = new campaignEcommAddOrder(input);
    campaignEcommAddOrderOutput output = cmd.Execute();
        
    // --------------------------------------
    // result
    bool apiResult = output.result;