$(document).on('click', '.product-removal button', function () {
    let cart = $(this).data('item') === 'cart';

    removeItem(this, cart);
});

function removeItem(removeButton, cart) {
    let parent = $(removeButton).closest('.product');

    parent.slideUp(300, function () {
        parent.remove();

        updateTotal(cart);
    });
}