1$(document).ready(function() { 2 // Удаление ÑоваÑа из коÑÐ·Ð¸Ð½Ñ Ð°ÑкÑом 3 $('body').on('click', '.js-delete-from-cart', function() { 4 5 var $this = $(this); 6 var itemId = $this.data('delete-item-id'); 7 var property = $this.data('property'); 8 var $vari = $this.data('variant'); 9 const fullSummElem = $('.full-summ'); 10 $.ajax({ 11 type: "POST", 12 url: mgBaseDir + "/cart", 13 data: { 14 action: "cart", // название дейÑÑÐ²Ð¸Ñ Ð² полÑзоваÑелÑÑком клаÑÑа Ajaxuser 15 delFromCart: 1, 16 itemId: itemId, 17 property: property, 18 variantId: $vari 19 }, 20 dataType: "json", 21 cache: false, 22 success: function(response) { 23 if ('success' == response.status) { 24 if (response.deliv && response.curr) { 25 var i = 0; 26 response.deliv.forEach(function(element, index, arr) { 27 $('.delivery-details-list li:eq(' + i + ') .deliveryPrice').html(' ' + element); 28 if ($('.delivery-details-list input[type=radio]:eq(' + i + ')').is(':checked')) { 29 if (element == 0) { 30 if (fullSummElem.length === 0) { 31 $('.summ-info .delivery-summ').html(''); 32 } else { 33 $('.summ-info .delivery-summ').html('<span class="order-delivery-summ">' + element + ' ' + response.curr + '</span>'); 34 } 35 } else { 36 if (fullSummElem.length === 0) { 37 $('.summ-info .delivery-summ').html(locale.delivery + ' <span class="order-delivery-summ">' + element + ' ' + response.curr + '</span>'); 38 } else { 39 $('.summ-info .delivery-summ').html('<span class="order-delivery-summ">' + element + ' ' + response.curr + '</span>'); 40 } 41 } 42 } 43 i++; 44 }); 45 } 46 if (!$vari) $vari = 0;
47 var table = $('.deleteItemFromCart[data-property="' + property + '"][data-delete-item-id="' + itemId + '"][data-variant="' + $vari + '"]').parents('table'); 48 if ($vari) { 49 $('.deleteItemFromCart[data-property="' + property + '"][data-delete-item-id="' + itemId + '"][data-variant="' + $vari + '"]').parents('tr').remove(); 50 } else { 51 $('.deleteItemFromCart[data-property="' + property + '"][data-delete-item-id="' + itemId + '"]').parents('tr').remove(); 52 } 53 54 var i = 1; 55 table.find('.index').each(function() { 56 $(this).text(i++); 57 }); 58 $('.total-sum strong,.total .total-sum span.total-payment, .total-price-block .total-sum, .mg-desktop-cart .total-sum span.total-payment,.mg-fake-cart .total-sum span.total-payment').text(response.data.cart_price_wc); 59 response.data.cart_price = response.data.cart_price ? response.data.cart_price : 0; 60 response.data.cart_count = response.data.cart_count ? response.data.cart_count : 0; 61 $('.pricesht').text(response.data.cart_price); 62 $('.countsht').text(response.data.cart_count); 63 if (window.fullSumm) { 64 window.fullSumm.value = parseFloat(String(response.data.cart_price).replace(',', '.').replaceAll(' ', '')); 65 } 66 if ($('.small-cart-table tr').length == 0) { 67 68 $('html').removeClass('c-modal--scroll'); 69 $('#js-modal__cart').removeClass('c-modal--open'); 70 $('.product-cart, .checkout-form-wrapper, .small-cart').hide(); 71 $('.empty-cart-block').show(); 72 73 } 74 } 75 } 76 }); 77 return false; 78 }); 79 80 if ($('.small-cart-table tr').length == 0) { 81 $('.product-cart, .checkout-form-wrapper, .small-cart').hide(); 82 $('.empty-cart-block').show(); 83 } 84});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.