templates/frontend/cart/js/remove-item.js.twig line 1

Open in your IDE?
  1. $(document).on('click', '.remove-from-cart', function () {
  2.     let elementInCartCount = $('#cart-table tr').length;
  3.     let uuidArea = $(this).data('uuid');
  4.     let url = '{{ path("app_frontend_cart_remove_item", {'uuidCustomerAdvertisingArea': 'uuidCustomerAdvertisingArea'}) }}';
  5.     elementInCartCount--;
  6.     url = url.replace("uuidCustomerAdvertisingArea", uuidArea);
  7.     if (elementInCartCount === 0) {
  8.         $('#toCheckoutBtn').addClass('disabled');
  9.     }
  10.     $.ajax({
  11.         url: url,
  12.         method: "GET",
  13.         dataType: 'json',
  14.         success: function () {
  15.             $('.cart-table-area')
  16.                 .find('.cart-product-row-'+uuidArea)
  17.                 .fadeOut();
  18.             refreshCartTotalAndItemCount();
  19.         }
  20.     });
  21. });