$arProductPrice[$priceCode] = $item['PROPERTIES'][$priceCode]['VALUE'];
$arProductPrice[$priceCode] = $item['PROPERTIES'][$priceCode]['~VALUE'];
<? if (!defined('B_PROLOG_INCLUDED') || B_PROLOG_INCLUDED !== true) die();
use \Bitrix\Main;
/**
* @global CMain $APPLICATION
* @var array $arParams
* @var array $arResult
* @var CatalogProductsViewedComponent $component
* @var CBitrixComponentTemplate $this
* @var string $templateName
* @var string $componentPath
* @var string $templateFolder
*/
$this->setFrameMode(true);
if (isset($arResult['ITEM']))
{
$item = $arResult['ITEM'];
$areaId = $arResult['AREA_ID'];
$productTitle = isset($item['IPROPERTY_VALUES']['ELEMENT_PAGE_TITLE']) && $item['IPROPERTY_VALUES']['ELEMENT_PAGE_TITLE'] != ''
? $item['IPROPERTY_VALUES']['ELEMENT_PAGE_TITLE']
: $item['NAME'];
$imgTitle = isset($item['IPROPERTY_VALUES']['ELEMENT_PREVIEW_PICTURE_FILE_TITLE']) && $item['IPROPERTY_VALUES']['ELEMENT_PREVIEW_PICTURE_FILE_TITLE'] != ''
? $item['IPROPERTY_VALUES']['ELEMENT_PREVIEW_PICTURE_FILE_TITLE']
: $item['NAME'];
$showSlider = is_array($item['MORE_PHOTO']) && count($item['MORE_PHOTO']) > 0;
$itemHasDetailUrl = isset($item['DETAIL_PAGE_URL']) && $item['DETAIL_PAGE_URL'] != '';
$arProductPrice = array();
if(isset($arParams['PROPERTY_PRICE']) && $arParams['PROPERTY_PRICE']) {
foreach((array) $arParams['PROPERTY_PRICE'] as $priceCode) {
if(isset($item['PROPERTIES'][$priceCode]) && $item['PROPERTIES'][$priceCode]['VALUE']) {
$arProductPrice[$priceCode] = $item['PROPERTIES'][$priceCode]['VALUE'];
}
}
}
//$productPrice = ( !empty($item['PROPERTIES'][$arParams['PROPERTY_PRICE']]['VALUE']) ? $item['PROPERTIES'][$arParams['PROPERTY_PRICE']]['VALUE'] : false );
//echo_r($item);
?>
<div class="product-item-wrap" id="<?=$areaId?>" data-entity="item">
<div class="product-item">
<a href="<?=$item['DETAIL_PAGE_URL']?>" class="full"></a>
<? if ($showSlider) { ?>
<div class="product-thumb" id="product-thumb-<?=$areaId?>">
<?
foreach ($item['MORE_PHOTO'] as $key => $photo) {
if ($key > 4) continue;
?>
<div><a href="<?=$item['DETAIL_PAGE_URL']?>"><img src="<?=$photo['SRC']?>" alt=""></a></div>
<? } ?>
</div>
<? } ?>
<div class="product-body">
<div class="product-head text-primary">
<h5 class="product-title"><a href="<?=$item['DETAIL_PAGE_URL']?>"><?=$productTitle?></a></h5>
</div>
<div class="product-option">
<? if (!empty($item['DISPLAY_PROPERTIES'])) { ?>
<ul class="list-inline">
<? foreach ($item['DISPLAY_PROPERTIES'] as $code => $displayProperty) { ?>
<li class="list-inline-item">
<span><?=$displayProperty['NAME']?></span>
<strong class="text-primary"><?=(is_array($displayProperty['DISPLAY_VALUE']) ? implode(' / ', $displayProperty['DISPLAY_VALUE']) : $displayProperty['DISPLAY_VALUE'])?></strong>
</li>
<? } ?>
</ul>
<? } ?>
</div>
<div class="product-price text-primary">
<?/*if ($productPrice) { ?>
<span><? echo number_format($productPrice, 0, '.', ' '); ?> р.</span>
<? }*/ ?>
<?if($arProductPrice):?>
<?foreach($arProductPrice as $productPrice):?>
<div><? echo number_format($productPrice, 0, '.', ' '); ?> р.</div>
<?endforeach;?>
<?endif;?>
</div>
<? if ($itemHasDetailUrl): ?>
<a href="<?=$item['DETAIL_PAGE_URL']?>" class="btn btn-outline-primary">Подробнее</a>
<? endif; ?>
</div>
</div>
<script>
$(document).ready(function(){
$('#product-thumb-<?=$areaId?>').slick({
slidesToShow: 1,
slidesToScroll: 1,
dots: true,
arrows:false,
infinite: true,
touchMove: true,
draggable:true,
lazyLoad: 'ondemand',
fade:true
});
});
</script>
</div>
<?
}
<? if (!defined('B_PROLOG_INCLUDED') || B_PROLOG_INCLUDED !== true) die();
use \Bitrix\Main;
/**
* @global CMain $APPLICATION
* @var array $arParams
* @var array $arResult
* @var CatalogProductsViewedComponent $component
* @var CBitrixComponentTemplate $this
* @var string $templateName
* @var string $componentPath
* @var string $templateFolder
*/
$this->setFrameMode(true);
if (isset($arResult['ITEM']))
{
$item = $arResult['ITEM'];
$areaId = $arResult['AREA_ID'];
$productTitle = isset($item['IPROPERTY_VALUES']['ELEMENT_PAGE_TITLE']) && $item['IPROPERTY_VALUES']['ELEMENT_PAGE_TITLE'] != ''
? $item['IPROPERTY_VALUES']['ELEMENT_PAGE_TITLE']
: $item['NAME'];
$imgTitle = isset($item['IPROPERTY_VALUES']['ELEMENT_PREVIEW_PICTURE_FILE_TITLE']) && $item['IPROPERTY_VALUES']['ELEMENT_PREVIEW_PICTURE_FILE_TITLE'] != ''
? $item['IPROPERTY_VALUES']['ELEMENT_PREVIEW_PICTURE_FILE_TITLE']
: $item['NAME'];
$showSlider = is_array($item['MORE_PHOTO']) && count($item['MORE_PHOTO']) > 0;
$itemHasDetailUrl = isset($item['DETAIL_PAGE_URL']) && $item['DETAIL_PAGE_URL'] != '';
$arProductPrice = array();
if(isset($arParams['PROPERTY_PRICE']) && $arParams['PROPERTY_PRICE']) {
foreach((array) $arParams['PROPERTY_PRICE'] as $priceCode) {
if(isset($item['PROPERTIES'][$priceCode]) && $item['PROPERTIES'][$priceCode]['VALUE']) {
$arProductPrice[$priceCode] = $item['PROPERTIES'][$priceCode]['VALUE'];
}
}
}
//$productPrice = ( !empty($item['PROPERTIES'][$arParams['PROPERTY_PRICE']]['VALUE']) ? $item['PROPERTIES'][$arParams['PROPERTY_PRICE']]['VALUE'] : false );
//echo_r($item);
?>
<div class="product-item-wrap" id="<?=$areaId?>" data-entity="item">
<div class="product-item">
<a href="<?=$item['DETAIL_PAGE_URL']?>" class="full"></a>
<? if ($showSlider) { ?>
<div class="product-thumb" id="product-thumb-<?=$areaId?>">
<?
foreach ($item['MORE_PHOTO'] as $key => $photo) {
if ($key > 4) continue;
?>
<div><a href="<?=$item['DETAIL_PAGE_URL']?>"><img src="<?=$photo['SRC']?>" alt=""></a></div>
<? } ?>
</div>
<? } ?>
<div class="product-body">
<div class="product-head text-primary">
<h5 class="product-title"><a href="<?=$item['DETAIL_PAGE_URL']?>"><?=$productTitle?></a></h5>
</div>
<div class="product-option">
<? if (!empty($item['DISPLAY_PROPERTIES'])) { ?>
<ul class="list-inline">
<? foreach ($item['DISPLAY_PROPERTIES'] as $code => $displayProperty) { ?>
<li class="list-inline-item">
<span><?=$displayProperty['NAME']?></span>
<strong class="text-primary"><?=(is_array($displayProperty['DISPLAY_VALUE']) ? implode(' / ', $displayProperty['DISPLAY_VALUE']) : $displayProperty['DISPLAY_VALUE'])?></strong>
</li>
<? } ?>
</ul>
<? } ?>
</div>
<div class="product-price text-primary">
<?/*if ($productPrice) { ?>
<span><? echo number_format($productPrice, 0, '.', ' '); ?> р.</span>
<? }*/ ?>
<?if($arProductPrice):?>
<?foreach($arProductPrice as $productPrice):?>
<div><? echo number_format($productPrice, 0, '.', ' '); ?> р.</div>
<?endif;?>
<?endif;?>
</div>
<? if ($itemHasDetailUrl): ?>
<a href="<?=$item['DETAIL_PAGE_URL']?>" class="btn btn-outline-primary">Подробнее</a>
<? endif; ?>
</div>
</div>
<script>
$(document).ready(function(){
$('#product-thumb-<?=$areaId?>').slick({
slidesToShow: 1,
slidesToScroll: 1,
dots: true,
arrows:false,
infinite: true,
touchMove: true,
draggable:true,
lazyLoad: 'ondemand',
fade:true
});
});
</script>
</div>
<?
}
<?
$APPLICATION->IncludeComponent(
'bitrix:catalog.item',
'estate',
array(
'RESULT' => array(
'ITEM' => $item,
'AREA_ID' => $areaIds[$item['ID']],
'TYPE' => $rowData['TYPE'],
'BIG_LABEL' => 'N',
'BIG_DISCOUNT_PERCENT' => 'N',
'BIG_BUTTONS' => 'N',
'SCALABLE' => 'N'
),
'PARAMS' => $generalParams
+ array('SKU_PROPS' => $arResult['SKU_PROPS'][$item['IBLOCK_ID']])
),
$component,
array('HIDE_ICONS' => 'Y')
);
?>
Собственно вопрос: как передать выбранный элемент в поле типа text?
Failed to execute 'requestFullscreen' on 'Element': API can only be initiated by a user gesture.
$(document).ready(function() {
$('твой селектор').on('click', function() {
if(document.fullscreenElement) {
document.exitFullscreen();
}
else {
document.documentElement.requestFullscreen();
}
});
});
'COLUMNS' => 'значение'
Параметр появляется в настройках, но в шаблон не прилетает, что не так делаю?
его надо еще где простой компонент вызывается добавлять. Параметр сам по себе не гуляет между компонентами, в комплексный компонент он пришел, теперь надо его в простой передать
'NEW' => $arParams['NEW']
<?=($arParams['COLUMNS'] == 'значение' ? 'class="свой класс"' : '');?>