<commit_before><!-- <h4 class="title_cart">Корзина</h4> -->
<script>
	var randomManager;
</script>
<?if(empty($list)){
	if(isset($cart['id_order'])){
		if($_GET['type'] == 'order'){?>
			<script>
				ga('ecommerce:addTransaction', {
					id: '<?=$cart['id_order'];?>',									// Transaction ID. Required.
					affiliation: '<?=$GLOBALS['CONFIG']['invoice_logo_text']?>',	// Affiliation or store name.
					revenue: '<?=$cart['sum_discount']?>'							// Grand Total.
				});
			</script>
			<?foreach($cart['products'] as $p){?>
				<script>
					ga('ecommerce:addItem', {
						'id': '<?=$cart['id_order']?>',								// Transaction ID. Required.
						'name': '<?=str_replace("'", '"', $p['name'])?>',			// Product name. Required.
						'sku': '<?=$p['art']?>',									// SKU/code.
						'category': '<?=$p['id_category']?>',						// Category or variation.
						'price': '<?=$p['site_price_opt']?>',						// Unit price.
						'quantity': '<?=$p['order_opt_qty']+$p['order_mopt_qty']?>'	// Quantity.
					});
				</script>
			<?}?>
			<?if($p['order_opt_qty'] > 0){?>
				<!-- <script>
					ga('ecommerce:addItem', {
					'id': '<?=$cart['id_order']?>',								// Transaction ID. Required.
					'name': '<?=str_replace("'", '"', $p['name'])?>',			// Product name. Required.
					'sku': '<?=$p['art']?>',									// SKU/code.
					'category': '<?=$p['id_category']?>',						// Category or variation.
					'price': '<?=$p['site_price_opt']?>',						// Unit price.
					'quantity': '<?=$p['order_opt_qty']?>'						// Quantity.
					});
				</script>-->
			<?}
			if($p['order_mopt_qty'] > 0){?>
				<!-- <script>
					ga('ecommerce:addItem', {
					'id': '<?=$cart['id_order']?>',								// Transaction ID. Required.
					'name': '<?=str_replace("'", '"', $p['name'])?>',			// Product name. Required.
					'sku': '<?=$p['art']?>',									// SKU/code.
					'category': '<?=$p['id_category']?>',						// Category or variation.
					'price': '<?=$p['site_price_mopt']?>',						// Unit price.
					'quantity': '<?=$p['order_mopt_qty']?>'						// Quantity.
					});
				</script> -->
			<?}?>
			<!-- <script>ga('ecommerce:send');</script> -->
		<?}?>
		<div class="success_order">
			<?if($_GET['type'] == 'draft'){?>
				<h2>Черновик сохранен</h2>
				<img src="<?=file_exists($GLOBALS['PATH_root'].'/images/draft__saved.png')?_base_url.'/images/draft__saved.png':'/images/nofoto.png'?>" alt="draft saved">
				<p>
					<a href="/customer_order/<?=$cart['id_order']?>" class="btn-m-green">Посмотреть состав черновика</a>
					<a href="/cabinet/" class="btn-m-green">Перейти в личный кабинет</a>
				</p>
			<?}else{?>
				<h2>Спасибо за Ваш заказ</h2>
				<img src="<?=file_exists($GLOBALS['PATH_root'].'/images/operator.png')?_base_url.'/images/operator.png':'/images/nofoto.png'?>" alt="draft saved">
				<div class="order_info">
					<p>Заказ <b>№<?=$cart['id_order']?></b> принят.</p>
					<p>В ближайшее время с Вами свяжется менеджер.</p>
				</div>
				<p>
					<a href="/customer_order/<?=$cart['id_order']?>" class="btn-m-green">Посмотреть состав заказа</a>
					<a href="/cabinet/" class="btn-m-green">Перейти в личный кабинет</a>
				</p>
			<?}?>
		</div>
	<?}?>
<?}else{?>
	<!-- Недоступные товары -->
	<!--<?if(isset($_SESSION['cart']['unavailable_products']) && !empty($_SESSION['cart']['unavailable_products'])){?>
		<div class="msg-warning">
			<p>
				<?=$count = count($unlist);?>
				<?if($count == 1){?>
					товар сейчас недоступен.
				<?}elseif(substr($count, -1) == 1 && substr($count, -2, 1) != 1){?>
					товар сейчас недоступен.
				<?}elseif(substr($count, -1) == 2 || substr($count, -1) == 3 || substr($count, -1) == 4 && substr($count, -2, 1) != 1){?>
					товара сейчас недоступно.
				<?}else{?>
					товаров сейчас недоступно.
				<?}?>
			</p>
		</div>
	<?}?>
	<?if(G::IsLogged() && $_SESSION['member']['gid'] == _ACL_MANAGER_){?>
		<?if(!empty($unlist)){?>
			<a href="#" class="show_btn" onclick="$(this).next().toggleClass('hidden'); return false;">Показать недоступные товары</a>
			<div class="unavailable_products hidden animate" id="unavailable_products">
				<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table paper_shadow_1">
					<colgroup>
						<col width="20%">
						<col width="80%">
					</colgroup>
					<thead>
						<tr>
							<td class="left">Артикул</td>
							<td class="left">Название</td>
						</tr>
					</thead>
					<tbody>
						<?foreach($unlist as $ul){?>
							<tr>
								<td class="left"><?=$ul['art']?></td>
								<td class="left">
									<a href="/product/<?=$ul['id_product'].'/'.$ul['translit']?>/"><?=$ul['name']?></a>
								</td>
							</tr>
						<?}?>
					</tbody>
				</table>
			</div>
		<?}?>
	<?}?>-->
	<!-- END Недоступные товары -->

	<!-- New Недоступные товары -->
	<?if(isset($unlist) && !empty($unlist)){?>
		<div class="unorder_wrapp">
			<h5>Временно недоступные товары</h5>
			<?foreach($unlist as $p){?>
				<div class="card inaccessible_product" id="cart_item_<?=$p['id_product']?>">
					<div class="card_wrapper">
						<div class="product_photo">
							<a href="<?=Link::Product($p['translit']);?>">
								<?if(!empty($p['images'])){?>
									<img alt="<?=htmlspecialchars(G::CropString($p['name']))?>" src="<?=G::GetImageUrl($p['images'][0]['src'], 'thumb')?>"/>
								<?}else{?>
									<img alt="<?=htmlspecialchars(G::CropString($p['name']))?>" src="<?=G::GetImageUrl($p['img_1'], 'thumb')?>"/>
								<?}?>
							</a>
						</div>
						<div class="product_name">
							<a href="<?=Link::Product($p['translit']);?>" class="description_<?=$p['id_product'];?>">
								<?=G::CropString($p['name'], 180)?>
							</a>
							<span class="product_article">Артикул: <?=$p['art']?></span>
						</div>
						<div class="unorder_msg">
							<div class="wlist_msg_wrap wlist_msg_wrap_js" data-id-product="<?=$p['id_product'];?>" <?=G::isLogged()?'data-id-user="'.$_SESSION['member']['id_user'].'" data-email="'.$_SESSION['member']['email'].'"':'';?> >
								<span class="del_wrap_js<?=isset($_SESSION['member']['waiting_list']) && in_array($p['id_product'], $_SESSION['member']['waiting_list'])?null:' hidden';?>">
									<span id="in_wl_arrow_<?=$p['id_product']?>" class="in_waiting_list fortrending_arrow icon material-icons">trending_down</span>
									Товар в "<a href="<?=Link::Custom('cabinet','waitinglist')?>" <?=$GLOBALS['CurrentController'] == 'product'?'rel="nofollow"':null;?> >Листе ожидания</a>"
									<span class="mdl-tooltip" for="in_wl_arrow_<?=$p['id_product']?>">Товар уже<br>в списке ожидания</span>
								</span>
								<span class="add_wrap_js<?=isset($_SESSION['member']['waiting_list']) && in_array($p['id_product'], $_SESSION['member']['waiting_list'])?' hidden':null;?>">
									<span id="out_wl_arrow_<?=$p['id_product']?>" class="fortrending_arrow icon material-icons add_del_waiting_list_js">trending_down</span>
									Добавить в "Лист ожидания"
									<span class="mdl-tooltip" for="out_wl_arrow_<?=$p['id_product']?>">Следить за ценой</span>
								</span>
							</div>
						</div>
					</div>
				</div>
			<?}?>
			<h5>Товары в корзине</h5>
		</div>
	<?}?>
	<!-- End Недоступные товары -->

	<!-- NEW Товары в корзине -->
	<?if(promo::HasGift()){
		if(isset($gift)){?>
			<div class="card gift_card">
				<div class="card_wrapper">
					<div class="product_photo">
						<a href="<?=Link::Product($gift['translit']);?>">
							<?if(!empty($gift['images'])){?>
								<img alt="<?=htmlspecialchars(G::CropString($gift['name']))?>" src="<?=G::GetImageUrl($gift['images'][0]['src'], 'thumb')?>"/>
							<?}else{?>
								<img alt="<?=htmlspecialchars(G::CropString($gift['name']))?>" src="<?=G::GetImageUrl($gift['img_1'], 'thumb')?>"/>
							<?}?>
						</a>
					</div>
					<div class="product_name">
						<a href="<?=Link::Product($gift['translit']);?>" class="description_<?=$gift['id_product'];?>">
							<?=G::CropString($gift['name'], 180)?>
						</a>
						<span class="product_article">Артикул: <?=$gift['art']?></span>
					</div>
					<div class="product_buy">
						ВАШ ПОДАРОК
					</div>
					<div class="remove_prod">
						<div class="mdl-button mdl-js-button mdl-button--accent btn_js" data-name="gift_select">Сменить</div>
					</div>
				</div>
			</div>
		<?}else{?>
			<div class="gift_item">
				<div class="gift_title">Выбирай подарок на свой вкус!</div>
				<div class="mdl-button mdl-js-button mdl-button--accent btn_js" data-name="gift_select">Выбрать</div>
			</div>
		<?}
	}?><commit_msg>"Заменить"<commit_after><!-- <h4 class="title_cart">Корзина</h4> -->
<script>
	var randomManager;
</script>
<?if(empty($list)){
	if(isset($cart['id_order'])){
		if($_GET['type'] == 'order'){?>
			<script>
				ga('ecommerce:addTransaction', {
					id: '<?=$cart['id_order'];?>',									// Transaction ID. Required.
					affiliation: '<?=$GLOBALS['CONFIG']['invoice_logo_text']?>',	// Affiliation or store name.
					revenue: '<?=$cart['sum_discount']?>'							// Grand Total.
				});
			</script>
			<?foreach($cart['products'] as $p){?>
				<script>
					ga('ecommerce:addItem', {
						'id': '<?=$cart['id_order']?>',								// Transaction ID. Required.
						'name': '<?=str_replace("'", '"', $p['name'])?>',			// Product name. Required.
						'sku': '<?=$p['art']?>',									// SKU/code.
						'category': '<?=$p['id_category']?>',						// Category or variation.
						'price': '<?=$p['site_price_opt']?>',						// Unit price.
						'quantity': '<?=$p['order_opt_qty']+$p['order_mopt_qty']?>'	// Quantity.
					});
				</script>
			<?}?>
			<?if($p['order_opt_qty'] > 0){?>
				<!-- <script>
					ga('ecommerce:addItem', {
					'id': '<?=$cart['id_order']?>',								// Transaction ID. Required.
					'name': '<?=str_replace("'", '"', $p['name'])?>',			// Product name. Required.
					'sku': '<?=$p['art']?>',									// SKU/code.
					'category': '<?=$p['id_category']?>',						// Category or variation.
					'price': '<?=$p['site_price_opt']?>',						// Unit price.
					'quantity': '<?=$p['order_opt_qty']?>'						// Quantity.
					});
				</script>-->
			<?}
			if($p['order_mopt_qty'] > 0){?>
				<!-- <script>
					ga('ecommerce:addItem', {
					'id': '<?=$cart['id_order']?>',								// Transaction ID. Required.
					'name': '<?=str_replace("'", '"', $p['name'])?>',			// Product name. Required.
					'sku': '<?=$p['art']?>',									// SKU/code.
					'category': '<?=$p['id_category']?>',						// Category or variation.
					'price': '<?=$p['site_price_mopt']?>',						// Unit price.
					'quantity': '<?=$p['order_mopt_qty']?>'						// Quantity.
					});
				</script> -->
			<?}?>
			<!-- <script>ga('ecommerce:send');</script> -->
		<?}?>
		<div class="success_order">
			<?if($_GET['type'] == 'draft'){?>
				<h2>Черновик сохранен</h2>
				<img src="<?=file_exists($GLOBALS['PATH_root'].'/images/draft__saved.png')?_base_url.'/images/draft__saved.png':'/images/nofoto.png'?>" alt="draft saved">
				<p>
					<a href="/customer_order/<?=$cart['id_order']?>" class="btn-m-green">Посмотреть состав черновика</a>
					<a href="/cabinet/" class="btn-m-green">Перейти в личный кабинет</a>
				</p>
			<?}else{?>
				<h2>Спасибо за Ваш заказ</h2>
				<img src="<?=file_exists($GLOBALS['PATH_root'].'/images/operator.png')?_base_url.'/images/operator.png':'/images/nofoto.png'?>" alt="draft saved">
				<div class="order_info">
					<p>Заказ <b>№<?=$cart['id_order']?></b> принят.</p>
					<p>В ближайшее время с Вами свяжется менеджер.</p>
				</div>
				<p>
					<a href="/customer_order/<?=$cart['id_order']?>" class="btn-m-green">Посмотреть состав заказа</a>
					<a href="/cabinet/" class="btn-m-green">Перейти в личный кабинет</a>
				</p>
			<?}?>
		</div>
	<?}?>
<?}else{?>
	<!-- Недоступные товары -->
	<!--<?if(isset($_SESSION['cart']['unavailable_products']) && !empty($_SESSION['cart']['unavailable_products'])){?>
		<div class="msg-warning">
			<p>
				<?=$count = count($unlist);?>
				<?if($count == 1){?>
					товар сейчас недоступен.
				<?}elseif(substr($count, -1) == 1 && substr($count, -2, 1) != 1){?>
					товар сейчас недоступен.
				<?}elseif(substr($count, -1) == 2 || substr($count, -1) == 3 || substr($count, -1) == 4 && substr($count, -2, 1) != 1){?>
					товара сейчас недоступно.
				<?}else{?>
					товаров сейчас недоступно.
				<?}?>
			</p>
		</div>
	<?}?>
	<?if(G::IsLogged() && $_SESSION['member']['gid'] == _ACL_MANAGER_){?>
		<?if(!empty($unlist)){?>
			<a href="#" class="show_btn" onclick="$(this).next().toggleClass('hidden'); return false;">Показать недоступные товары</a>
			<div class="unavailable_products hidden animate" id="unavailable_products">
				<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table paper_shadow_1">
					<colgroup>
						<col width="20%">
						<col width="80%">
					</colgroup>
					<thead>
						<tr>
							<td class="left">Артикул</td>
							<td class="left">Название</td>
						</tr>
					</thead>
					<tbody>
						<?foreach($unlist as $ul){?>
							<tr>
								<td class="left"><?=$ul['art']?></td>
								<td class="left">
									<a href="/product/<?=$ul['id_product'].'/'.$ul['translit']?>/"><?=$ul['name']?></a>
								</td>
							</tr>
						<?}?>
					</tbody>
				</table>
			</div>
		<?}?>
	<?}?>-->
	<!-- END Недоступные товары -->

	<!-- New Недоступные товары -->
	<?if(isset($unlist) && !empty($unlist)){?>
		<div class="unorder_wrapp">
			<h5>Временно недоступные товары</h5>
			<?foreach($unlist as $p){?>
				<div class="card inaccessible_product" id="cart_item_<?=$p['id_product']?>">
					<div class="card_wrapper">
						<div class="product_photo">
							<a href="<?=Link::Product($p['translit']);?>">
								<?if(!empty($p['images'])){?>
									<img alt="<?=htmlspecialchars(G::CropString($p['name']))?>" src="<?=G::GetImageUrl($p['images'][0]['src'], 'thumb')?>"/>
								<?}else{?>
									<img alt="<?=htmlspecialchars(G::CropString($p['name']))?>" src="<?=G::GetImageUrl($p['img_1'], 'thumb')?>"/>
								<?}?>
							</a>
						</div>
						<div class="product_name">
							<a href="<?=Link::Product($p['translit']);?>" class="description_<?=$p['id_product'];?>">
								<?=G::CropString($p['name'], 180)?>
							</a>
							<span class="product_article">Артикул: <?=$p['art']?></span>
						</div>
						<div class="unorder_msg">
							<div class="wlist_msg_wrap wlist_msg_wrap_js" data-id-product="<?=$p['id_product'];?>" <?=G::isLogged()?'data-id-user="'.$_SESSION['member']['id_user'].'" data-email="'.$_SESSION['member']['email'].'"':'';?> >
								<span class="del_wrap_js<?=isset($_SESSION['member']['waiting_list']) && in_array($p['id_product'], $_SESSION['member']['waiting_list'])?null:' hidden';?>">
									<span id="in_wl_arrow_<?=$p['id_product']?>" class="in_waiting_list fortrending_arrow icon material-icons">trending_down</span>
									Товар в "<a href="<?=Link::Custom('cabinet','waitinglist')?>" <?=$GLOBALS['CurrentController'] == 'product'?'rel="nofollow"':null;?> >Листе ожидания</a>"
									<span class="mdl-tooltip" for="in_wl_arrow_<?=$p['id_product']?>">Товар уже<br>в списке ожидания</span>
								</span>
								<span class="add_wrap_js<?=isset($_SESSION['member']['waiting_list']) && in_array($p['id_product'], $_SESSION['member']['waiting_list'])?' hidden':null;?>">
									<span id="out_wl_arrow_<?=$p['id_product']?>" class="fortrending_arrow icon material-icons add_del_waiting_list_js">trending_down</span>
									Добавить в "Лист ожидания"
									<span class="mdl-tooltip" for="out_wl_arrow_<?=$p['id_product']?>">Следить за ценой</span>
								</span>
							</div>
						</div>
					</div>
				</div>
			<?}?>
			<h5>Товары в корзине</h5>
		</div>
	<?}?>
	<!-- End Недоступные товары -->

	<!-- NEW Товары в корзине -->
	<?if(promo::HasGift()){
		if(isset($gift)){?>
			<div class="card gift_card">
				<div class="card_wrapper">
					<div class="product_photo">
						<a href="<?=Link::Product($gift['translit']);?>">
							<?if(!empty($gift['images'])){?>
								<img alt="<?=htmlspecialchars(G::CropString($gift['name']))?>" src="<?=G::GetImageUrl($gift['images'][0]['src'], 'thumb')?>"/>
							<?}else{?>
								<img alt="<?=htmlspecialchars(G::CropString($gift['name']))?>" src="<?=G::GetImageUrl($gift['img_1'], 'thumb')?>"/>
							<?}?>
						</a>
					</div>
					<div class="product_name">
						<a href="<?=Link::Product($gift['translit']);?>" class="description_<?=$gift['id_product'];?>">
							<?=G::CropString($gift['name'], 180)?>
						</a>
						<span class="product_article">Артикул: <?=$gift['art']?></span>
					</div>
					<div class="product_buy">
						ВАШ ПОДАРОК
					</div>
					<div class="remove_prod">
						<div class="mdl-button mdl-js-button mdl-button--accent btn_js" data-name="gift_select">Заменить</div>
					</div>
				</div>
			</div>
		<?}else{?>
			<div class="gift_item">
				<div class="gift_title">Выбирай подарок на свой вкус!</div>
				<div class="mdl-button mdl-js-button mdl-button--accent btn_js" data-name="gift_select">Выбрать</div>
			</div>
		<?}
	}?>
{'fraction_non_alphanumeric': 0.27019727571629876, 'fraction_numerical': 0.0056364490371066224, 'mean_word_length': 3.5873956369512525, 'pattern_counts': {'":': 0, '<': 503, '<?xml version=': 0, '>': 507, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '947194', 'n_tokens_mistral': 8126, 'n_tokens_neox': 6605, 'n_words': 942}