jQuery( function( $ ) {
    $( document ).on( 'change', 'input[name^="cart["]', function() {
        var cart_item_key = $(this).closest('.woocommerce-cart-form__cart-item').data('cart_item_key');
        var new_rental_days = $(this).val();
        $.ajax({
            type: 'POST',
            url: cart_rental_days_params.ajax_url,
            data: {
                action: 'update_rental_days',
                cart_key: cart_item_key,
                new_rental_days: new_rental_days,
                nonce: cart
