JQuery Ajax and Web Service
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
Figured it out !!!
Simply append the shoppingCartId to the URL:
url: getBaseURL() + "Sitefinity/Public/Services/Ecommerce/Order/CartOrder.svc/" + $.cookie("shoppingCartId") + "/",
Martin