PageSourceSearch

https://pantum-printers.ru/includes/javascript/jsevents.js?v=1789051345

js pantum-printers.ru collected 2026-10-03 19:40:22 UTC 19,681 bytes, 487 lines download raw bytes

1function deleteProductEvent( data ) {
2	if ( data.for_del && data.for_del.length) {
3		if( PROSKTR.shop.id == 'COFFEE' && typeof APRT_SEND =="function") {
4			$.each(data.for_del, function(i, product_for_del) {
5				window.APRT_SEND({
6					pageType: 9,
7					currentProduct: {
8						id: product_for_del.products_id,
9						name: product_for_del.products_name,
10						price: product_for_del.final_price * product_for_del.qty,
11					}
12				});
13				// adriver
14				// (function(h){function k(){var a=function(d,b){if(this instanceof AdriverCounter)d=a.items.length||1,a.items[d]=this,b.ph=d,b.custom&&(b.custom=a.toQueryString(b.custom,";")),a.request(a.toQueryString(b));else return a.items[d]};a.httplize=function(a){return(/^\/\//.test(a)?location.protocol:"")+a};a.loadScript=function(a){try{var b=g.getElementsByTagName("head")[0],c=g.createElement("script");c.setAttribute("type","text/javascript");c.setAttribute("charset","windows-1251");c.setAttribute("src",a.split("![rnd]").join(Math.round(1E6*Math.random())));c.onreadystatechange=function(){/loaded|complete/.test(this.readyState)&&(c.onload=null,b.removeChild(c))};c.onload=function(){b.removeChild(c)};b.insertBefore(c,b.firstChild)}catch(f){}};a.toQueryString=function(a,b,c){b=b||"&";c=c||"=";var f=[],e;for(e in a)a.hasOwnProperty(e)&&f.push(e+c+escape(a[e]));return f.join(b)};a.request=function(d){var b=a.toQueryString(a.defaults);a.loadScript(a.redirectHost+"/cgi-bin/erle.cgi?"+d+"&rnd=![rnd]"+(b?"&"+b:""))};a.items=[];a.defaults={tail256:document.referrer||"unknown"};a.redirectHost=a.httplize("//ad.adriver.ru");return a}var g=document;"undefined"===typeof AdriverCounter&&(AdriverCounter=k());new AdriverCounter(0,h)})
15				// ({sid:176867, bt:62, sz:'del_basket', custom: {10:product_for_del.products_id,11:product_for_del.cPath,153:'user_id'}});
16				// /adriver
17			});
18		}
19		if( PROSKTR.shop.id == 'PRO' ) {
20			//RuTarget
21			var _rutarget=window._rutarget||[];
22			var total_price = 0;
23			var productsArr = [];
24			$.each(data.for_del, function(i, product_for_del) {
25				_rutarget.push({'event':'removeFromCart','sku':product_for_del.products_id });
26				var product = { "id": product_for_del.products_id, "price": product_for_del.final_price, "price_old": product_for_del.products_price };
27				productsArr.push( product );
28				total_price += product_for_del.final_price * product_for_del.qty;
29			});
30
31			var eventData = {
32				"products": productsArr,
33				"currency_code": "RUR",
34				"total_price": total_price,
35			};
36			// if( window._myVKProxy ) {
37			// 	window._myVKProxy.push(['Retargeting.ProductEvent', [ PROSKTR.vkRetargeting.price_list_id, "remove_from_cart", eventData ]]);
38			// } else if ( window.VK && VK.Retargeting ) {
39			// 	if( PROSKTR.vkRetargeting ) VK.Retargeting.ProductEvent( PROSKTR.vkRetargeting.price_list_id, "remove_from_cart", eventData );
40			// }
41			//RuTarget
42
43			/*
44			// Adsniper
45			window.ad_retag = window.ad_retag || [];
46			window.ad_retag.push({level: 9});
47			var ad_products = [
48			];
49			$.each(data.for_del, function(i, product_for_del) {
50				ad_products.push({
51				"id": product_for_del.products_id, //ай-ди товара 
52				"number": product_for_del.qty,  //количество единиц данного товара
53				});
54			});
55			(function() {
56				var s = document.createElement("script");
57				s.async = true;
58				s.src = (document.location.protocol == "https:" ?
59					"https:" : "http:") + "//ad.adsniper.ru/rcmd3.js";
60				var
61					a = document.getElementsByTagName("script")[0];
62				a.parentNode.insertBefore(s, a);
63			})();
64			// /Adsniper
65			*/
66		}
67		if ( true ) {
68			var total_price = 0;
69			var productsArr = [];
70			$.each(data.for_del, function(i, product_for_del) {
71				var product = { "id": product_for_del.products_id, "price": product_for_del.final_price, "price_old": product_for_del.products_price };
72				productsArr.push( product );
73				total_price += product_for_del.final_price * product_for_del.qty;
74			});
75
76			var eventData = {
77				"products": productsArr,
78				"currency_code": "RUR",
79				"total_price": total_price,
80			};
81			if( PROSKTR.shop.id == 'PRO' /*&& window._myVKProxy*/ ) {
82				// window._myVKProxy.push(['Retargeting.ProductEvent', [ PROSKTR.vkRetargeting.price_list_id, "remove_from_cart", eventData ]]);
83			} else if ( window.VK ) {
84				if( PROSKTR.vkRetargeting ) VK.Retargeting.ProductEvent( PROSKTR.vkRetargeting.price_list_id, "remove_from_cart", eventData );
85			}
86		}
87		window.dataLayer = window.dataLayer || [];
88		if( PROSKTR.shop.id != 'TAMARIS' && PROSKTR.shop.id != 'ANTA' ) {
89			$.each(data.for_del, function (i, product_for_del) {
90				var key = 'productList_' + product_for_del.products_id,
91					listName = localStorage.getItem(key) ? localStorage.getItem(key) : location.pathname;
92				window.dataLayer.push({
93					"event": "removeFromCart",
94					"ecommerce": {
95						"remove": {
96							"products": [
97								{
98									"id": product_for_del.products_id,
99									"name": product_for_del.products_name,
100									"category": product_for_del.cattovara_full,
101									"brand": product_for_del.manufacturers_name,
102									"quantity": product_for_del.qty,
103									"price": product_for_del.final_price,
104									'index': 1,
105									'item_list_name': listName,
106								}
107							]
108						}
109					}
110				});
111			});
112		}
113	}
114	if( PROSKTR.shop.id == 'BBNG' || PROSKTR.shop.id == 'PRO' ) {
115		var mindboxProductsList = [];
116		var operation = '';
117		var skuIdKey = '';
118		var idKey = '';
119		if ( PROSKTR.shop.id == 'BBNG' ) {
120			operation = 'SetUpCartBillabong';
121			skuIdKey = 'billaBong';
122		} else if ( PROSKTR.shop.id == 'PRO' ) {
123			operation = 'SetCartProskater';
124			skuIdKey = 'proskater';
125			idKey = 'proskater';
126		}
127		for (var i = data.products.length - 1; i >= 0; i--) {
128			var productItem = {
129				'product': {
130					'sku': {
131						'ids': {}
132					}
133				},
134				'count': data.products[i].quantity,
135				'price': data.products[i].final_price * data.products[i].quantity,
136			};
137			productItem.product.sku.ids[skuIdKey] = data.products[i].product_article.replace('-', '');
138			if( idKey.length ) {
139				productItem.product.ids = {};
140				productItem.product.ids[idKey] = data.products[i].products_id;
141			}
142			mindboxProductsList.push( productItem );
143		}
144		mindbox("async", {
145			'operation': operation,
146			'data': {
147				'productList': mindboxProductsList
148			}
149		});
150	}
151}
152
153function searchQueryAddToCartGoals(data) {
154	if (data.search_query_events && data.search_query_events.length && typeof ym === 'function' && PROSKTR.yaCounterId) {
155		for (var searchEventIndex = 0; searchEventIndex < data.search_query_events.length; searchEventIndex++) {
156			ym(PROSKTR.yaCounterId, 'reachGoal', 'search_add_to_cart', {
157				search_funnel: data.search_query_events[searchEventIndex]
158			});
159		}
160	}
161}
162
163function addProductEvent( data ) {
164	searchQueryAddToCartGoals(data);
165	window.google_tag_params = {
166		ecomm_prodid: data.ecomm_prodid,
167		ecomm_pagetype: 'cart',
168		ecomm_totalvalue: data.ecomm_totalvalue,
169	};
170	if(typeof ym === "function" && PROSKTR.yaCounterId){
171		if(PROSKTR.content == 'index_products' || PROSKTR.content == 'specials' ){
172			ym(PROSKTR.yaCounterId,'reachGoal','add_to_basket_catalog');
173		}
174		if(PROSKTR.content == 'wishlist'){
175			ym(PROSKTR.yaCounterId,'reachGoal','add_to_basket_wishlist');
176		}
177		if(PROSKTR.content == 'product_info'){
178			ym(PROSKTR.yaCounterId,'reachGoal','add_to_basket_product');
179		}
180	}
181	if( PROSKTR.shop.id == 'PRO' ) {
182		if( data.iamback ) {
183			$(document).append(data.iamback);
184		}
185	}
186	if (window.remarketing) {
187		for (i = 0; i < window.remarketing.length; i++) {
188			$('body').append(window.remarketing[i]);
189		}
190	}
191	var total_price = 0;
192	var productsArr = [];
193	for (var addProdi = data.added_product.length - 1; addProdi >= 0; addProdi--) {
194		var product = { "id": data.added_product[addProdi].products_id, "price": parseInt( data.added_product[addProdi].price ) };
195		productsArr.push( product );
196		total_price += parseInt( data.added_product[addProdi].price );
197		if( PROSKTR.shop.id == 'PRO' || PROSKTR.shop.id == 'STEIN' || PROSKTR.shop.id == 'KARMAN' || PROSKTR.shop.id == 'IRIDATO' || PROSKTR.shop.id == 'TURBO' || PROSKTR.shop.id == 'DOM' ) {
198
199			// BOF adRiver
200			/*
201			(function(h){function k(){var a=function(d,b){if(this instanceof AdriverCounter)d=a.items.length||1,a.items[d]=this,b.ph=d,b.custom&&(b.custom=a.toQueryString(b.custom,";")),a.request(a.toQueryString(b));else return a.items[d]};a.httplize=function(a){return(/^\/\//.test(a)?location.protocol:"")+a};a.loadScript=function(a){try{var b=g.getElementsByTagName("head")[0],c=g.createElement("script");c.setAttribute("type","text/javascript");c.setAttribute("charset","windows-1251");c.setAttribute("src",a.split("![rnd]").join(Math.round(1E6*Math.random())));c.onreadystatechange=function(){/loaded|complete/.test(this.readyState)&&(c.onload=null,b.removeChild(c))};c.onload=function(){b.removeChild(c)};b.insertBefore(c,b.firstChild)}catch(f){}};a.toQueryString=function(a,b,c){b=b||"&";c=c||"=";var f=[],e;for(e in a)a.hasOwnProperty(e)&&f.push(e+c+escape(a[e]));return f.join(b)};a.request=function(d){var b=a.toQueryString(a.defaults);a.loadScript(a.redirectHost+"/cgi-bin/erle.cgi?"+d+"&rnd=![rnd]"+(b?"&"+b:""))};a.items=[];a.defaults={tail256:document.referrer||"unknown"};a.redirectHost=a.httplize("//ad.adriver.ru");return a}var g=document;"undefined"===typeof AdriverCounter&&(AdriverCounter=k());new AdriverCounter(0,h)})
202			({sid:176867, bt:62, sz:'add_basket', custom: {10:data.added_product[addProdi].products_id,11:data.added_product[addProdi].categories_id,153:'user_id'}});
203			*/
204			// EOF adRiver
205			
206			var _rutarget = window._rutarget||[];
207			_rutarget.push({'event': 'addToCart', 'sku': data.added_product[addProdi].products_id});
208			// _gaq.push(["_trackEvent", "Links-Product_info", "Click", "AddToShoppingCart"]);
209			if(window.ga) {
210				ga('ec:addProduct', {
211					'id': data.added_product[addProdi].products_id,
212					'name': data.added_product[addProdi].name,
213					'category': data.added_product[addProdi].categories_id,
214					'price': data.added_product[addProdi].price,
215					'variant': data.added_product[addProdi].color,
216					'brand': data.added_product[addProdi].manufacturers_id,
217					'quantity': data.added_product[addProdi].quantity,
218				});
219				ga('ec:setAction', 'add', {list: 'Search Results'});
220				ga('send', 'event', 'UX', 'click', 'add_to_cart', 0, true);
221			}
222		}
223		if( PROSKTR.shop.id == 'PRO' || PROSKTR.shop.id == 'COFFEE' ) {
224			
225			if( PROSKTR.shop.id == 'COFFEE' && typeof APRT_SEND === "function") {
226				APRT_SEND({
227				pageType: 8,
228				currentProduct: {
229					id: data.added_product[addProdi].products_id,
230					name: data.added_product[addProdi].name,
231					price: data.added_product[addProdi].price
232				}
233				});
234			}
235			/* версия с конфликтными названиями переменными
236			 window._retag = window._retag || []; 
237			 window.ad_products = [ 
238			 {"id": data.added_product[addProdi].products_id, "number": "1",},
239			 ]; 
240			 window._retag.push({level: 8}); 
241			 (function () { 
242			 var s=document.createElement("script"); 
243			 s.async=true; 
244			 s.src=(document.location.protocol == "https:" ? 
245			 "https:" : "http:") + "//ad.adsniper.ru/rcmd3.js"; 
246			 var 
247			 a=document.getElementsByTagName("script")[0] 
248			 a.parentNode.insertBefore(s, a); 
249			 })();
250			 */
251			 /*
252			 window.ad_retag = window.ad_retag || [];
253			 window.ad_retag.push({level: 8});
254			 window.ad_products = [
255			{
256				 "id": data.added_product[addProdi].products_id, //ай-ди товара 
257				 "number": "1",  //количество единиц данного товара 
258			 },
259			 ];
260			 (function() {
261			 var s = document.createElement("script");
262			 s.async = true;
263			 s.src = (document.location.protocol == "https:" ?
264				"https:" : "http:") + "//ad.adsniper.ru/rcmd3.js";
265			 var
266				a = document.getElementsByTagName("script")[0];
267			 a.parentNode.insertBefore(s, a);
268			 })();
269			*/
270			window._tmr = _tmr || [];
271			window._tmr.push({id: data.added_product[addProdi].products_id, type: 'reachGoal', goal: 'AddToShoppingCart'});
272			window._tmr.push({ id: data.added_product[addProdi].products_id, type: 'reachGoal', goal: 'addtocart' });
273			window._fbq = window._fbq || [];
274			window._fbq.push(['track', 'AddToCart', {}]);
275		}
276
277		window.dataLayer = window.dataLayer || [];
278		if( PROSKTR.shop.id === 'BRD'){
279			var key = 'productList_' + data.added_product[addProdi].products_id,
280				listName = localStorage.getItem(key) ? localStorage.getItem(key) : '';
281
282			if(Array.isArray(dataLayer)) {
283				window.dataLayer.push({
284					"event": 'addToCart',
285					"currencyCode": PROSKTR.currencies.code,
286					"ecommerce": {
287						"add": {
288							"products": [
289								{
290									"name": data.added_product[addProdi].name,
291									"id": data.added_product[addProdi].products_id,
292									"price": data.added_product[addProdi].final_price,
293									"brand": data.added_product[addProdi].manufacturers_name,
294									"category": data.added_product[addProdi].cattovara_full,
295									"quantity": data.added_product[addProdi].quantity,
296									'item_list_name': listName,
297									'index': 1,
298								}
299							]
300						}
301					}
302				});
303			}
304		}else
305		if( PROSKTR.shop.id !== 'ANTA' && Array.isArray(dataLayer)) {
306			window.dataLayer.push({
307				"event": 'addToCart',
308				"currencyCode": PROSKTR.currencies.code,
309				"ecommerce": {
310					"add": {
311						"products": [
312							{
313								"name": data.added_product[addProdi].name,
314								"id": data.added_product[addProdi].products_id,
315								"price": data.added_product[addProdi].final_price,
316								"brand": data.added_product[addProdi].manufacturers_name,
317								"category": data.added_product[addProdi].cattovara_full,
318								"quantity": data.added_product[addProdi].quantity,
319							}
320						]
321					}
322				}
323			});
324		}
325		if( PROSKTR.shop.id !== 'ANTA' && window['yaCounter' + window.PROSKTR.yaCounterId] ) window['yaCounter' + window.PROSKTR.yaCounterId].reachGoal('add_to_basket');
326	}
327	var eventData = {
328		"products": productsArr,
329		"currency_code": "RUR",
330		"total_price": total_price,
331	};
332	if( PROSKTR.shop.id == 'PRO' /*&& window._myVKProxy*/ ) {
333		// window._myVKProxy.push(['Retargeting.ProductEvent', [ PROSKTR.vkRetargeting.price_list_id, "add_to_cart", eventData ]]);
334	} else if ( window.VK && VK.Retargeting ) {
335		if( PROSKTR.vkRetargeting ) VK.Retargeting.ProductEvent( PROSKTR.vkRetargeting.price_list_id, "add_to_cart", eventData );
336	}
337	if( PROSKTR.shop.id == 'BBNG' || PROSKTR.shop.id == 'PRO' ) {
338		var mindboxProductsList = [];
339		var operation = '';
340		var skuIdKey = '';
341		var idKey = '';
342
343		if ( PROSKTR.shop.id == 'BBNG' ) {
344			operation = 'SetUpCartBillabong';
345			skuIdKey = 'billaBong';
346		} else if ( PROSKTR.shop.id == 'PRO' ) {
347			operation = 'SetCartProskater';
348			skuIdKey = 'proskater';
349			idKey = 'proskater';
350		}
351		for (var i = data.products.length - 1; i >= 0; i--) {
352			var productItem = {
353				'product': {
354					'sku': {
355						'ids': {}
356					}
357				},
358				'count': data.products[i].quantity,
359				'price': data.products[i].final_price * data.products[i].quantity,
360			};
361			productItem.product.sku.ids[skuIdKey] = data.products[i].product_article.replace('-', '');
362			if( idKey.length ) {
363				productItem.product.ids = {};
364				productItem.product.ids[idKey] = data.products[i].products_id;
365			}
366			mindboxProductsList.push( productItem );
367		}
368		mindbox("async", {
369			'operation': operation,
370			'data': {
371				'productList': mindboxProductsList
372			}
373		});
374	}
375}
376function shopsOfProductPopupEvent( data ) {
377	if(window.ga) ga('send', 'event', 'Show_Prinfo_StockInShops', data.productName, data.shops, {'nonInteraction': 1});
378}
379
380function addWishlistEvent( productsId, response ) {
381	if( true ) {
382		var product = { "id": productsId };
383		var productsArr = [ product ];
384		var eventData = {
385			"products": productsArr,
386		};
387		if( PROSKTR.shop.id == 'PRO' /*&& window._myVKProxy*/ ) {
388			// window._myVKProxy.push(['Retargeting.ProductEvent', [ PROSKTR.vkRetargeting.price_list_id, "add_to_wishlist", eventData ]]);
389		} else if ( window.VK && VK.Retargeting ) {
390			if( PROSKTR.vkRetargeting ) VK.Retargeting.ProductEvent( PROSKTR.vkRetargeting.price_list_id, "add_to_wishlist", eventData );
391		}
392	}
393	if( PROSKTR.shop.id == 'BBNG' || PROSKTR.shop.id == 'PRO' ) {
394		var mindboxProducts = [];
395		var operation = '';
396		var idKey = '';
397
398		if ( PROSKTR.shop.id == 'BBNG' ) {
399			operation = 'SetUpFavoritesBillabong';
400			idKey = 'billaBong';
401		} else if ( PROSKTR.shop.id == 'PRO' ) {
402			operation = 'SetFavoritesProskater';
403			idKey = 'proskater';
404		}
405		for (var i = response.products.length - 1; i >= 0; i--) {
406			var productItem = {
407				'product': {
408					'ids': {}
409				},
410				'count': 1,
411				'price': response.products[i].current_price
412			};
413			productItem.product.ids[idKey] = response.products[i].products_id;
414			mindboxProducts.push( productItem );
415		}
416		mindbox("async", {
417			'operation': operation,
418			'data': {
419				'productList': mindboxProducts
420			}
421		});
422	}
423}
424
425function removeWishlistEvent( productsId, response ) {
426	if( true ) {
427		var product = { "id": productsId };
428		var productsArr = [ product ];
429		var eventData = {
430			"products": productsArr,
431		};
432		if( PROSKTR.shop.id == 'PRO' /*&& window._myVKProxy*/ ) {
433			// window._myVKProxy.push(['Retargeting.ProductEvent', [ PROSKTR.vkRetargeting.price_list_id, "remove_from_wishlist", eventData ]]);
434		} else if ( window.VK && VK.Retargeting ) {
435			if( PROSKTR.vkRetargeting ) VK.Retargeting.ProductEvent( PROSKTR.vkRetargeting.price_list_id, "remove_from_wishlist", eventData );
436		}
437	}
438	if( PROSKTR.shop.id == 'BRD' || PROSKTR.shop.id == 'BBNG' || PROSKTR.shop.id == 'PRO' ) {
439		var mindboxProducts = [];
440		var operation = '';
441		var idKey = '';
442		if( PROSKTR.shop.id == 'BRD' ) {
443			operation = 'SetIzbrannoeBoardridersItemList';
444			idKey = 'boardriders';
445		} else if ( PROSKTR.shop.id == 'BBNG' ) {
446			operation = 'SetUpFavoritesBillabong';
447			idKey = 'billaBong';
448		} else if ( PROSKTR.shop.id == 'PRO' ) {
449			operation = 'SetFavoritesProskater';
450			idKey = 'proskater';
451		}
452		for (var i = response.products.length - 1; i >= 0; i--) {
453			var productItem = {
454				'product': {
455					'ids': {}
456				},
457				'count': 1,
458				'price': response.products[i].current_price
459			};
460			productItem.product.ids[idKey] = response.products[i].products_id;
461			mindboxProducts.push( productItem );
462		}
463		mindbox("async", {
464			'operation': operation,
465			'data': {
466				'productList': mindboxProducts
467			}
468		});
469	}
470}
471
472$( document ).ajaxSuccess(function( event, request, settings ) {
473	var responseJSON = request.responseJSON;
474	if( responseJSON == undefined && request.responseText.length > 0 && settings.dataType == 'json' ) {
475		responseJSON = JSON.parse( request.responseText );
476	}
477	if( responseJSON != undefined && responseJSON.MYJSEvents != undefined && responseJSON.MYJSEvents.length ) {
478		for (var i = responseJSON.MYJSEvents.length - 1; i >= 0; i--) {
479			if( typeof window[ responseJSON.MYJSEvents[i][0] ] == 'function' ) {
480				window[ responseJSON.MYJSEvents[i][0] ].apply(null, responseJSON.MYJSEvents[i][1]);
481			} else if( responseJSON.MYJSEvents[i][0].indexOf('dataLayer.push')!=-1 ) {
482				window.dataLayer = window.dataLayer || [];
483				window.dataLayer.push( responseJSON.MYJSEvents[i][1][0] );
484			}
485		}
486	}
487});

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.