PageSourceSearch

https://skybeat.ru/bitrix/js/logictim.balls/basket.js?17787433133343

js skybeat.ru collected 2026-10-07 20:49:13 UTC 3,343 bytes, 107 lines download raw bytes

1BX.ready(function(){
2	if(!BX.Sale || !BX.Sale.BasketComponent)
3		return;
4		
5		logictimBasket('first');
6});
7
8BX.addCustomEvent('onAjaxSuccess', function(command,params) {
9	if (params) {
10		logictimBasket(params);
11	}
12});
13
14
15function logictimBasket(params) {
16	
17	if(!BX.Sale || !BX.Sale.BasketComponent)
18		return;
19	
20	if(!BX.Sale.BasketComponent.result)
21		return;
22		
23	if(!BX.Sale.BasketComponent.result.GRID.ROWS && BX.Sale.BasketComponent.result.BASKET_ITEM_RENDER_DATA) //DLYA ASPRO
24		BX.Sale.BasketComponent.result.GRID.ROWS = BX.Sale.BasketComponent.result.BASKET_ITEM_RENDER_DATA;
25	if(!BX.Sale.BasketComponent.result.GRID.ROWS)
26		return;
27	
28	if(params.url == '/bitrix/components/logictim/bonus.ajax/bonus_cart_ajax.php')
29		return;
30	
31	//CHECK CAN_BUY
32	var rows = [];
33	for(id in BX.Sale.BasketComponent.result.GRID.ROWS) {
34		var row = BX.Sale.BasketComponent.result.GRID.ROWS[id];
35		if(row['CAN_BUY'] != 'N' && row['NOT_AVAILABLE'] != true)
36			rows[id] = row;
37	}
38	
39	var data = new Object();
40	if(arLogictimBonusCart)
41	{
42		data["SITE_ID"] = arLogictimBonusCart.SITE_ID;
43		data["LANGUAGE_ID"] = arLogictimBonusCart.LANGUAGE_ID;
44	}
45	data["ROWS"] = rows;
46	BX.ajax({
47		url: '/bitrix/components/logictim/bonus.ajax/bonus_cart_ajax.php',
48		method: 'POST',
49		data: data,
50		dataType: 'json',
51		onsuccess: function(result) {
52			setBonusInBasket(result);
53		}
54	});
55}
56
57function setBonusInBasket(result) {
58	
59	//for standart template of cart
60	if(BX.findChild(BX('basket-root'), {'tag': 'div', 'class': 'basket-checkout-block-total-price-inner'}, true))
61		var itog_block = BX.findChild(BX('basket-root'), {'tag': 'div', 'class': 'basket-checkout-block-total-price-inner'}, true);
62	else
63	{
64		//for template of Aspro.Max 'V2'
65		if(BX.findChild(BX('basket-root'), {'tag': 'div', 'class': 'basket-coupon-block-total-price-current'}, true))
66			var itog_block = BX.findChild(BX('basket-root'), {'tag': 'div', 'class': 'basket-coupon-block-total-price-current'}, true);
67	}
68	
69	var bonus_all = BX.create('DIV', {props: {id: 'bonus_all', className: 'lt_cart_bonus_all'}, style: {order: '10', fontWeight: 'normal'}, html: result.ALL_BONUS_FORMAT});
70	BX.remove(BX('bonus_all'));
71	
72	if(parseFloat(result.ALL_BONUS) > 0)
73		itog_block.appendChild(bonus_all);
74	
75	for(id in result.ITEMS) {
76		var item = result.ITEMS[id];
77		var product_block = BX('basket-item-'+item.BASKET_ITEM_ID);
78		
79		if(!product_block)
80			continue;
81		
82		BX.remove(BX('bonus_item_'+item.BASKET_ITEM_ID));
83		var bonus_item = BX.create('DIV', {props: {id: 'bonus_item_'+item.BASKET_ITEM_ID, className: 'bonus bonus_item_cart'}, style: {order: '10', fontWeight: 'normal'}, html: item.ADD_BONUS_FORMAT});
84		
85		//NEW CART VERSION
86		if(BX('basket-item-sum-price-'+item.BASKET_ITEM_ID))
87		{
88			var price_for_item = BX('basket-item-sum-price-'+item.BASKET_ITEM_ID);
89			if(parseFloat(item.ADD_BONUS) > 0)
90				price_for_item.appendChild(bonus_item);
91		}
92		//OLD CART VERSION
93		else
94		{
95			var price_blocks = BX.findChild(product_block, {'tag': 'div', 'class': 'basket-item-block-price'}, true, true);
96			var price_for_one = price_blocks[0];
97			var price_for_item = price_blocks[1];
98			
99			if(parseFloat(item.ADD_BONUS) > 0)
100				price_for_item.appendChild(bonus_item);
101		}
102			
103		//console.log(price_for_one);
104	}
105	
106	
107}

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.