1// 1792 2;(function($) { 3 'use strict'; 4 5 $(function(){ 6 7 if (shop2.mode != 'cart') { 8 9 $(document).on('click', '.form-tin-btn', function(e) { 10 11 let productName = $(this).data('product-name'), 12 productAmount = $(this).parents('.shop-product').find('.shop2-product-amount input').val(), 13 price = +$(this).parents('.shop-product').find('.price-current strong').text().replace(/\s/g,''), 14 summ = productAmount * price, 15 test = $(this).data('test'), 16 promo = String($(this).data('promo')), 17 shopId = $(this).data('shopid'), 18 showcaseId = $(this).data('showcaseid'); 19 20 21 if(summ < 3000 || summ > 500000) { 22 alert('СÑмма заказа должна бÑÑÑ Ð½Ðµ менее 3000 и не более 500000 ÑÑб. вклÑÑиÑелÑно'); 23 $('.remodal[data-remodal-id="tin-form"] .remodal-close-btn').trigger('click'); 24 } else { 25 if(test) { 26 tinkoff.createDemo({ 27 sum: summ, 28 items: [{name: productName, price: price, quantity: productAmount}], 29 promoCode: promo, 30 shopId: shopId, 31 showcaseId: showcaseId 32 }, {view: 'modal'}) 33 } else { 34 tinkoff.create({ 35 sum: summ, 36 items: [{name: productName, price: price, quantity: productAmount}], 37 promoCode: promo, 38 shopId: shopId, 39 showcaseId: showcaseId 40 }, {view: 'modal'}) 41 } 42 } 43 }); 44 45 } 46 47 if (shop2.mode == 'cart') { 48 49 $(document).on('click', '.cart-tin-btn', function(e) { 50 51 let items = []; 52 53 let test = $(this).data('test'), 54 promo = String($(this).data('promo')), 55 shopId = $(this).data('shopid'), 56 showcaseId = $(this).data('showcaseid'), 57 summ = $(this).data('total'); 58 59 $('.shop2-cart-product.tin_p').each(function(){ 60 let name = $(this).data('name'), 61 price = +$(this).data('price'), 62 amount = $(this).data('amount'); 63 let arr = { 64 name: name, 65 price: price, 66 quantity: amount 67 } 68 items.push(arr) 69 }); 70 71 if(test) { 72 tinkoff.createDemo({ 73 sum: summ, 74 items: items, 75 promoCode: promo, 76 shopId: shopId, 77 showcaseId: showcaseId 78 }, {view: 'modal'}) 79 } else { 80 tinkoff.create({ 81 sum: summ, 82 items: items, 83 promoCode: promo, 84 shopId: shopId, 85 showcaseId: showcaseId 86 }, {view: 'modal'}) 87 } 88 }); 89 90 } 91 92 }); 93 94})(jQuery);
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.