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/Neopoints/momsecurity.be/resources/assets/js/shop/cart.js
var ShoppingCart = {
    // Initialize click event
    init: function () {
       // init something
    },
    addProductToShoppingcart: function (id, type) {
        let amount = 10;

        Ajax.post(
            '/addProductToShoppingcart',
            {productableID: id, itemType: type, amount: amount},
            function(xhr) {
                window.location = xhr.response;
            }
        );

    },
    removeItemFromShoppingcart: function (id, type) {
        Ajax.post(
            '/removeItemFromShoppingcart',
            {productableID: id, itemType: type},
            function(xhr) {
                window.location = xhr.response;
            }
        );
    },
    setItemAmountInShoppingcart: function (id, amount) {
        if (amount > 0) {
            Ajax.post(
                '/setItemAmountInShoppingcart',
                {itemID: id, amount: amount},
                function(xhr) {
                    window.location = xhr.response;
                }
            );
        } else {
            this.removeItemFromShoppingcart(id);
        }
    },
    updateCartButtonCounter: function () {
        var count = $(".shoppingcartItemList ul li").length;
        $(".shoppingCartButton span.shoppingCartButtonCounter").html(count);
    }
};
ShoppingCart.init();