HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
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;
});