File: D:/HostingSpaces/SBogers10/topswtw.komma.pro/wwwroot/js/app/checkout/productSessionService.ng.js
define([],function()
{
function productSessionService($http) {
var baseUrl = '/nl/winkelwagen';
return {
setBaseUrl: function(_baseUrl){
baseUrl = _baseUrl;
},
load: function () {
return $http.get(baseUrl + '/getCartAsJson');
},
set: function (id, newQuantity, callback) {
return $http.get(baseUrl + '/setQuantityProductById/' + id + '/' + newQuantity + '?ajax=1').success(callback);
},
add: function (id, callback) {
return $http.get(baseUrl + '/addProductById/' + id + '?ajax=1').success(callback);
},
subtract: function (id, callback) {
return $http.get(baseUrl + '/subtractProductById/' + id + '?ajax=1').success(callback);
},
remove: function (id, callback) {
return $http.get(baseUrl + '/removeProductById/' + id + '?ajax=1').success(callback);
},
checkCode: function(code, callback) {
return $http.get(baseUrl + '/checkCouponCode?code=' + code.toLowerCase() ).success(callback);
}
};
}
productSessionService.$inject = ['$http'];
return productSessionService;
});