PageSourceSearch

https://kostum66.ru/design/kostum66_1/js/ajax_cart.js

js kostum66.ru collected 2026-09-28 13:59:36 UTC 2,578 bytes, 129 lines download raw bytes

1// Аяксовая корзина
2function ajaxAddToCart(e){
3	var variant = $(e).closest('form').find('input[name=variant]:checked').val();
4	var amount = 1;
5	var build = 0;
6
7	$.ajax({
8		url: "ajax/cart.php",
9		data: {variant: variant, amount: amount, build: build},
10		dataType: 'json',
11		success: function(data){
12			$('#cart').html(data);
13
14			$.ajax({
15				url: "ajax/cartwindow.php",
16				dataType: 'json',
17				success: function(data){
18					$.modal(data);
19				}
20			});
21			
22			replaceLinks();
23		}
24	});  
25}
26
27
28
29$('form.variants').live('submit', function(e) {
30 
31	e.preventDefault();
32
33	button = $(this).find('input[type="submit"]');
34	if($(this).find('input[name=variant]:checked').size()>0)
35		variant = $(this).find('input[name=variant]:checked').val();
36	if($(this).find('select[name=variant]').size()>0)
37		variant = $(this).find('select').val();
38	
39	if($('.qnt').length > 0) amount = $('.qnt').html();
40	else amount = 1;
41	var build = 0;
42	
43	$.ajax({
44		url: "ajax/cart.php",
45		data: {variant: variant, amount: amount, build: build},
46		dataType: 'json',
47		success: function(data){
48			$('#cart').html(data);
49			if(button.attr('data-result-text'))
50				button.val(button.attr('data-result-text'));
51				
52			$.ajax({
53				url: "ajax/cartwindow.php",
54				dataType: 'json',
55				success: function(data){
56					$.modal(data);
57				}
58			});
59			
60			replaceLinks();
61		}
62	});
63	return false;
64});
65
66// Аяксовая корзина
67function ajaxUpdateQtyCart(variant_id, amount){
68	$.ajax({
69		url: "ajax/cartupdateqty.php",
70		data: {variant_id: variant_id, amount: amount},
71		dataType: 'json',
72		success: function(data){
73      location.href=location.href;
74      
75      
76      console.log(data);
77		}
78	});  
79}
80
81function cartWindowUpdate() {
82	var data = $("#cartwindowform").serialize();
83	$.ajax({
84		type: 'POST',
85		data: data,
86		cache: false,
87		url: "/cart",
88		success: function(d){
89			$.ajax({
90				url: "ajax/cartwindow.php",
91				dataType: 'json',
92				success: function(data){
93					$("#cartwindowcontent").html(data);
94					$.ajax({
95						url: "ajax/getcart.php",
96						dataType: 'json',
97						success: function(data){
98							$('#cart').html(data);
99						}
100					});
101				}
102			});
103		}
104	});
105}
106
107
108function cartWindowRemove(id) {
109	$.ajax({
110		type: 'GET',
111		url: "/cart/remove/"+id,
112		success: function(d){
113			$.ajax({
114				url: "ajax/cartwindow.php",
115				dataType: 'json',
116				success: function(data){
117					$("#cartwindowcontent").html(data);
118					$.ajax({
119						url: "ajax/getcart.php",
120						dataType: 'json',
121						success: function(data){
122							$('#cart').html(data);
123						}
124					});
125				}
126			});
127		}
128	});
129}

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.