+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / JQuery Ajax and Web Service

JQuery Ajax and Web Service

2 posts, 1 answered
  1. Martin
    Martin avatar
    22 posts
    Registered:
    27 Sep 2013
    13 Jun 2014
    Link to this post

    Hi

    I'm trying to use  jQuery to call Sitefinity/Public/Services/Ecommerce/Order/CartOrder.svc
    and get the current cart item (GetCartOrder)

    The jquery is working, however it's returning all cart items/orders
    NOT the specific item for $.cookie("shoppingCartId")

    Tested direct url in browser and it works!

    Code below:

                $.ajax({
                    type: "GET",
                    contentType: "application/json; charset=utf-8",
                    url: getBaseURL() + "Sitefinity/Public/Services/Ecommerce/Order/CartOrder.svc",
                    data: { cartOrderId: $.cookie("shoppingCartId") },
                    dataType: 'json',
                    success: function (data, textStatus, jqXHR) {
                        alert("success");

    Any help appreciated... :}

     Regards

    Martin

    Answered
  2. Martin
    Martin avatar
    22 posts
    Registered:
    27 Sep 2013
    13 Jun 2014 in reply to Martin
    Link to this post

    Figured it out !!!

     Simply append the shoppingCartId to the URL:

    url: getBaseURL() + "Sitefinity/Public/Services/Ecommerce/Order/CartOrder.svc/" + $.cookie("shoppingCartId") + "/",

    Martin

2 posts, 1 answered