<? if (!defined('B_PROLOG_INCLUDED') || B_PROLOG_INCLUDED !== true) die();
use \Bitrix\Main\Localization\Loc;
/**
* @global CMain $APPLICATION
* @var array $arParams
* @var array $arResult
* @var CatalogSectionComponent $component
* @var CBitrixComponentTemplate $this
* @var string $templateName
* @var string $componentPath
*
* _________________________________________________________________________
* | Attention!
* | The following comments are for system use
* | and are required for the component to work correctly in ajax mode:
* | <!-- items-container -->
* | <!-- pagination-container -->
* | <!-- component-end -->
*/
$this->setFrameMode(true);
if (!empty($arResult['NAV_RESULT']))
{
$navParams = array(
'NavPageCount' => $arResult['NAV_RESULT']->NavPageCount,
'NavPageNomer' => $arResult['NAV_RESULT']->NavPageNomer,
'NavNum' => $arResult['NAV_RESULT']->NavNum
);
}
else
{
$navParams = array(
'NavPageCount' => 1,
'NavPageNomer' => 1,
'NavNum' => $this->randString()
);
}
$showTopPager = false;
$showBottomPager = false;
$showLazyLoad = false;
if ($arParams['PAGE_ELEMENT_COUNT'] > 0 && $navParams['NavPageCount'] > 1)
{
$showTopPager = $arParams['DISPLAY_TOP_PAGER'];
$showBottomPager = $arParams['DISPLAY_BOTTOM_PAGER'];
$showLazyLoad = $arParams['LAZY_LOAD'] === 'Y' && $navParams['NavPageNomer'] != $navParams['NavPageCount'];
}
$elementEdit = CIBlock::GetArrayByID($arParams['IBLOCK_ID'], 'ELEMENT_EDIT');
$elementDelete = CIBlock::GetArrayByID($arParams['IBLOCK_ID'], 'ELEMENT_DELETE');
$elementDeleteParams = array('CONFIRM' => GetMessage('CT_BCS_TPL_ELEMENT_DELETE_CONFIRM'));
$arParams['~MESS_BTN_BUY'] = $arParams['~MESS_BTN_BUY'] ?: Loc::getMessage('CT_BCS_TPL_MESS_BTN_BUY');
$arParams['~MESS_BTN_DETAIL'] = $arParams['~MESS_BTN_DETAIL'] ?: Loc::getMessage('CT_BCS_TPL_MESS_BTN_DETAIL');
$arParams['~MESS_BTN_COMPARE'] = $arParams['~MESS_BTN_COMPARE'] ?: Loc::getMessage('CT_BCS_TPL_MESS_BTN_COMPARE');
$arParams['~MESS_BTN_SUBSCRIBE'] = $arParams['~MESS_BTN_SUBSCRIBE'] ?: Loc::getMessage('CT_BCS_TPL_MESS_BTN_SUBSCRIBE');
$arParams['~MESS_BTN_ADD_TO_BASKET'] = $arParams['~MESS_BTN_ADD_TO_BASKET'] ?: Loc::getMessage('CT_BCS_TPL_MESS_BTN_ADD_TO_BASKET');
$arParams['~MESS_NOT_AVAILABLE'] = $arParams['~MESS_NOT_AVAILABLE'] ?: Loc::getMessage('CT_BCS_TPL_MESS_PRODUCT_NOT_AVAILABLE');
$arParams['~MESS_SHOW_MAX_QUANTITY'] = $arParams['~MESS_SHOW_MAX_QUANTITY'] ?: Loc::getMessage('CT_BCS_CATALOG_SHOW_MAX_QUANTITY');
$arParams['~MESS_RELATIVE_QUANTITY_MANY'] = $arParams['~MESS_RELATIVE_QUANTITY_MANY'] ?: Loc::getMessage('CT_BCS_CATALOG_RELATIVE_QUANTITY_MANY');
$arParams['~MESS_RELATIVE_QUANTITY_FEW'] = $arParams['~MESS_RELATIVE_QUANTITY_FEW'] ?: Loc::getMessage('CT_BCS_CATALOG_RELATIVE_QUANTITY_FEW');
$arParams['MESS_BTN_LAZY_LOAD'] = $arParams['MESS_BTN_LAZY_LOAD'] ?: Loc::getMessage('CT_BCS_CATALOG_MESS_BTN_LAZY_LOAD');
$generalParams = array(
'PROPERTY_PRICE' => $arParams['PROPERTY_PRICE']
);
$obName = 'ob'.preg_replace('/[^a-zA-Z0-9_]/', 'x', $this->GetEditAreaId($navParams['NavNum']));
$containerName = 'container-'.$navParams['NavNum'];
?>
<div class="product-section">
<?
//region Pagination
if ($showTopPager)
{
?>
<div class="row mb-4">
<div class="col text-center" data-pagination-num="<?=$navParams['NavNum']?>">
<!-- pagination-container -->
<?=$arResult['NAV_STRING']?>
<!-- pagination-container -->
</div>
</div>
<?
}
//endregion
//region Description
if (($arParams['HIDE_SECTION_DESCRIPTION'] !== 'Y') && !empty($arResult['DESCRIPTION']))
{
?>
<div class="row mb-4">
<div class="col catalog-section-description">
<p><?=$arResult['DESCRIPTION']?></p>
</div>
</div>
<?
}
//endregion
?>
<div class="product-list" data-entity="<?=$containerName?>">
<!-- items-container -->
<?
if (!empty($arResult['ITEMS']) && !empty($arResult['ITEM_ROWS']))
{
$areaIds = array();
foreach ($arResult['ITEMS'] as $item)
{
$uniqueId = $item['ID'].'_'.md5($this->randString().$component->getAction());
$areaIds[$item['ID']] = $this->GetEditAreaId($uniqueId);
$this->AddEditAction($uniqueId, $item['EDIT_LINK'], $elementEdit);
$this->AddDeleteAction($uniqueId, $item['DELETE_LINK'], $elementDelete, $elementDeleteParams);
}
?>
<div class="row" data-entity="items-row">
<?
foreach ($arResult['ITEM_ROWS'] as $rowData)
{
$rowItems = array_splice($arResult['ITEMS'], 0, $rowData['COUNT']);
/*?>
<div class="row <?=$rowData['CLASS']?>" data-entity="items-row">
<?*/
switch ($rowData['VARIANT'])
{
case 0:
?>
<div class="col product-item-big-card">
<?
$item = reset($rowItems);
$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')
);
?>
</div>
<?
break;
case 1:
foreach ($rowItems as $item)
{
?>
<div class="col-6 product-item-big-card">
<?
$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')
);
?>
</div>
<?
}
break;
case 2:
foreach ($rowItems as $item)
{
?>
<div class="col-12 col-md-6 col-lg-4 product-item-small-card">
<?
$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' => 'Y',
'SCALABLE' => 'N'
),
'PARAMS' => $generalParams
+ array('SKU_PROPS' => $arResult['SKU_PROPS'][$item['IBLOCK_ID']])
),
$component,
array('HIDE_ICONS' => 'Y')
);
?>
</div>
<?
}
break;
case 3:
foreach ($rowItems as $item)
{
?>
<div class="col-6 col-md-3 product-item-small-card">
<?
$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')
);
?>
</div>
<?
}
break;
case 4:
$rowItemsCount = count($rowItems);
?>
<div class="col-sm-6 product-item-big-card">
<?
$item = array_shift($rowItems);
$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' => 'Y',
'SCALABLE' => 'Y'
),
'PARAMS' => $generalParams
+ array('SKU_PROPS' => $arResult['SKU_PROPS'][$item['IBLOCK_ID']])
),
$component,
array('HIDE_ICONS' => 'Y')
);
unset($item);
?>
</div>
<div class="col-sm-6 product-item-small-card">
<div class="row">
<?
for ($i = 0; $i < $rowItemsCount - 1; $i++)
{
?>
<div class="col-6">
<?
$APPLICATION->IncludeComponent(
'bitrix:catalog.item',
'estate',
array(
'RESULT' => array(
'ITEM' => $rowItems[$i],
'AREA_ID' => $areaIds[$rowItems[$i]['ID']],
'TYPE' => $rowData['TYPE'],
'BIG_LABEL' => 'N',
'BIG_DISCOUNT_PERCENT' => 'N',
'BIG_BUTTONS' => 'N',
'SCALABLE' => 'N'
),
'PARAMS' => $generalParams
+ array('SKU_PROPS' => $arResult['SKU_PROPS'][$rowItems[$i]['IBLOCK_ID']])
),
$component,
array('HIDE_ICONS' => 'Y')
);
?>
</div>
<?
}
?>
</div>
</div>
<?
break;
case 5:
$rowItemsCount = count($rowItems);
?>
<div class="col-sm-6 col-12 product-item-small-card">
<div class="row">
<?
for ($i = 0; $i < $rowItemsCount - 1; $i++)
{
?>
<div class="col-6">
<?
$APPLICATION->IncludeComponent(
'bitrix:catalog.item',
'estate',
array(
'RESULT' => array(
'ITEM' => $rowItems[$i],
'AREA_ID' => $areaIds[$rowItems[$i]['ID']],
'TYPE' => $rowData['TYPE'],
'BIG_LABEL' => 'N',
'BIG_DISCOUNT_PERCENT' => 'N',
'BIG_BUTTONS' => 'N',
'SCALABLE' => 'N'
),
'PARAMS' => $generalParams
+ array('SKU_PROPS' => $arResult['SKU_PROPS'][$rowItems[$i]['IBLOCK_ID']])
),
$component,
array('HIDE_ICONS' => 'Y')
);
?>
</div>
<?
}
?>
</div>
</div>
<div class="col-sm-6 product-item-big-card">
<?
$item = end($rowItems);
$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' => 'Y',
'SCALABLE' => 'Y'
),
'PARAMS' => $generalParams
+ array('SKU_PROPS' => $arResult['SKU_PROPS'][$item['IBLOCK_ID']])
),
$component,
array('HIDE_ICONS' => 'Y')
);
unset($item);
?>
</div>
<?
break;
case 6:
foreach ($rowItems as $item)
{
?>
<div class="col-6 col-sm-4 col-md-4 col-lg-2 product-item-small-card">
<?
$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')
);
?>
</div>
<?
}
break;
case 7:
$rowItemsCount = count($rowItems);
?>
<div class="col-sm-6 col-12 product-item-big-card">
<?
$item = array_shift($rowItems);
$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' => 'Y',
'SCALABLE' => 'Y'
),
'PARAMS' => $generalParams
+ array('SKU_PROPS' => $arResult['SKU_PROPS'][$item['IBLOCK_ID']])
),
$component,
array('HIDE_ICONS' => 'Y')
);
unset($item);
?>
</div>
<div class="col-sm-6 col-12 product-item-small-card">
<div class="row">
<?
for ($i = 0; $i < $rowItemsCount - 1; $i++)
{
?>
<div class="col-6 col-md-4">
<?
$APPLICATION->IncludeComponent(
'bitrix:catalog.item',
'estate',
array(
'RESULT' => array(
'ITEM' => $rowItems[$i],
'AREA_ID' => $areaIds[$rowItems[$i]['ID']],
'TYPE' => $rowData['TYPE'],
'BIG_LABEL' => 'N',
'BIG_DISCOUNT_PERCENT' => 'N',
'BIG_BUTTONS' => 'N',
'SCALABLE' => 'N'
),
'PARAMS' => $generalParams
+ array('SKU_PROPS' => $arResult['SKU_PROPS'][$rowItems[$i]['IBLOCK_ID']])
),
$component,
array('HIDE_ICONS' => 'Y')
);
?>
</div>
<?
}
?>
</div>
</div>
<?
break;
case 8:
$rowItemsCount = count($rowItems);
?>
<div class="col-sm-6 col-12 product-item-small-card">
<div class="row">
<?
for ($i = 0; $i < $rowItemsCount - 1; $i++)
{
?>
<div class="col-6 col-md-4">
<?
$APPLICATION->IncludeComponent(
'bitrix:catalog.item',
'estate',
array(
'RESULT' => array(
'ITEM' => $rowItems[$i],
'AREA_ID' => $areaIds[$rowItems[$i]['ID']],
'TYPE' => $rowData['TYPE'],
'BIG_LABEL' => 'N',
'BIG_DISCOUNT_PERCENT' => 'N',
'BIG_BUTTONS' => 'N',
'SCALABLE' => 'N'
),
'PARAMS' => $generalParams
+ array('SKU_PROPS' => $arResult['SKU_PROPS'][$rowItems[$i]['IBLOCK_ID']])
),
$component,
array('HIDE_ICONS' => 'Y')
);
?>
</div>
<?
}
?>
</div>
</div>
<div class="col-sm-6 col-12 product-item-big-card">
<?
$item = end($rowItems);
$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' => 'Y',
'SCALABLE' => 'Y'
),
'PARAMS' => $generalParams
+ array('SKU_PROPS' => $arResult['SKU_PROPS'][$item['IBLOCK_ID']])
),
$component,
array('HIDE_ICONS' => 'Y')
);
unset($item);
?>
</div>
<?
break;
case 9:
foreach ($rowItems as $item)
{
?>
<div class="col product-item-line-card">
<? $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'
),
'PARAMS' => $generalParams
+ array('SKU_PROPS' => $arResult['SKU_PROPS'][$item['IBLOCK_ID']])
),
$component,
array('HIDE_ICONS' => 'Y')
);
?>
</div>
<?
}
break;
}
/*?>
</div>
<?*/
}
?>
</div>
<?
unset($generalParams, $rowItems);
}
else
{
// load css for bigData/deferred load
$APPLICATION->IncludeComponent(
'bitrix:catalog.item',
'estate',
array(),
$component,
array('HIDE_ICONS' => 'Y')
);
}
?>
<!-- items-container -->
</div>
<?
//region LazyLoad Button
if ($showLazyLoad)
{
?>
<div class="text-center mb-4" data-entity="lazy-<?=$containerName?>">
<button type="button" class="btn btn-lg btn-outline-danger" style="margin: 15px;" data-use="show-more-<?=$navParams['NavNum']?>"><?=$arParams['MESS_BTN_LAZY_LOAD']?></button>
</div>
<?
}
//endregion
//region Pagination
if ($showBottomPager)
{
?>
<div class="row mb-4">
<div class="col text-center wow fadeInUp" data-wow-duration="1s" data-wow-delay="0" data-wow-offset="50" data-pagination-num="<?=$navParams['NavNum']?>">
<!-- pagination-container -->
<?=$arResult['NAV_STRING']?>
<!-- pagination-container -->
</div>
</div>
<?
}
//endregion
$signer = new \Bitrix\Main\Security\Sign\Signer;
$signedTemplate = $signer->sign($templateName, 'catalog.section');
$signedParams = $signer->sign(base64_encode(serialize($arResult['ORIGINAL_PARAMETERS'])), 'catalog.section');
?>
<script>
BX.message({
BTN_MESSAGE_BASKET_REDIRECT: '<?=GetMessageJS('CT_BCS_CATALOG_BTN_MESSAGE_BASKET_REDIRECT')?>',
BASKET_URL: '<?=$arParams['BASKET_URL']?>',
ADD_TO_BASKET_OK: '<?=GetMessageJS('ADD_TO_BASKET_OK')?>',
TITLE_ERROR: '<?=GetMessageJS('CT_BCS_CATALOG_TITLE_ERROR')?>',
TITLE_BASKET_PROPS: '<?=GetMessageJS('CT_BCS_CATALOG_TITLE_BASKET_PROPS')?>',
TITLE_SUCCESSFUL: '<?=GetMessageJS('ADD_TO_BASKET_OK')?>',
BASKET_UNKNOWN_ERROR: '<?=GetMessageJS('CT_BCS_CATALOG_BASKET_UNKNOWN_ERROR')?>',
BTN_MESSAGE_SEND_PROPS: '<?=GetMessageJS('CT_BCS_CATALOG_BTN_MESSAGE_SEND_PROPS')?>',
BTN_MESSAGE_CLOSE: '<?=GetMessageJS('CT_BCS_CATALOG_BTN_MESSAGE_CLOSE')?>',
BTN_MESSAGE_CLOSE_POPUP: '<?=GetMessageJS('CT_BCS_CATALOG_BTN_MESSAGE_CLOSE_POPUP')?>',
COMPARE_MESSAGE_OK: '<?=GetMessageJS('CT_BCS_CATALOG_MESS_COMPARE_OK')?>',
COMPARE_UNKNOWN_ERROR: '<?=GetMessageJS('CT_BCS_CATALOG_MESS_COMPARE_UNKNOWN_ERROR')?>',
COMPARE_TITLE: '<?=GetMessageJS('CT_BCS_CATALOG_MESS_COMPARE_TITLE')?>',
PRICE_TOTAL_PREFIX: '<?=GetMessageJS('CT_BCS_CATALOG_PRICE_TOTAL_PREFIX')?>',
RELATIVE_QUANTITY_MANY: '<?=CUtil::JSEscape($arParams['MESS_RELATIVE_QUANTITY_MANY'])?>',
RELATIVE_QUANTITY_FEW: '<?=CUtil::JSEscape($arParams['MESS_RELATIVE_QUANTITY_FEW'])?>',
BTN_MESSAGE_COMPARE_REDIRECT: '<?=GetMessageJS('CT_BCS_CATALOG_BTN_MESSAGE_COMPARE_REDIRECT')?>',
BTN_MESSAGE_LAZY_LOAD: '<?=CUtil::JSEscape($arParams['MESS_BTN_LAZY_LOAD'])?>',
BTN_MESSAGE_LAZY_LOAD_WAITER: '<?=GetMessageJS('CT_BCS_CATALOG_BTN_MESSAGE_LAZY_LOAD_WAITER')?>',
SITE_ID: '<?=CUtil::JSEscape($component->getSiteId())?>'
});
var <?=$obName?> = new JCCatalogSectionComponent({
siteId: '<?=CUtil::JSEscape($component->getSiteId())?>',
componentPath: '<?=CUtil::JSEscape($componentPath)?>',
navParams: <?=CUtil::PhpToJSObject($navParams)?>,
deferredLoad: false, // enable it for deferred load
initiallyShowHeader: '<?=!empty($arResult['ITEM_ROWS'])?>',
bigData: <?=CUtil::PhpToJSObject($arResult['BIG_DATA'])?>,
lazyLoad: !!'<?=$showLazyLoad?>',
loadOnScroll: !!'<?=($arParams['LOAD_ON_SCROLL'] === 'Y')?>',
template: '<?=CUtil::JSEscape($signedTemplate)?>',
ajaxId: '<?=CUtil::JSEscape($arParams['AJAX_ID'])?>',
parameters: '<?=CUtil::JSEscape($signedParams)?>',
container: '<?=$containerName?>'
});
</script>
</div> <? //end wrapper?>
<!-- component-end -->
<?
$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')
);
?>
<? 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'] != '';
$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>
<? } ?>
</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();
/**
* @var CBitrixComponentTemplate $this
* @var CatalogSectionComponent $component
*/
//$component = $this->getComponent();
//$arParams = $component->applyTemplateModifications();
//echo_r($arResult);
if(!CModule::IncludeModule("iblock")) return;
$item = $arResult['ITEM'];
$arImages = array();
if (!empty($item['PREVIEW_PICTURE_SECOND'])) {
$arImages[] = $item['PREVIEW_PICTURE_SECOND'];
}
if (!empty($item['MORE_PHOTO'])) {
foreach ($item['MORE_PHOTO'] as $arImage) {
if (!empty($arImage)) {
$arImages[] = $arImage;
}
}
}
if (!empty($item['PROPERTIES']['MORE_IMAGE_ALT']['VALUE']) && !empty($item['PROPERTIES']['MORE_IMAGE_ALT']['LINK_IBLOCK_ID'])) {
$res = CIBlockElement::GetList(
array(),
array("IBLOCK_ID"=>$item['PROPERTIES']['MORE_IMAGE_ALT']['LINK_IBLOCK_ID'], "ID"=>$item['PROPERTIES']['MORE_IMAGE_ALT']['VALUE']),
false,
false,
array("ID","IBLOCK_ID","NAME","PROPERTY_IMAGES")
);
if ($ob = $res->GetNextElement()) {
$arProps = $ob->GetProperties();
if (!empty($arProps['IMAGES']['VALUE'])) {
foreach ($arProps['IMAGES']['VALUE'] as $key=>$imageID) {
$arImage = CFile::ResizeImageGet($imageID, array('width'=>400, 'height'=>400), BX_RESIZE_IMAGE_PROPORTIONAL_ALT, true);
$arImages[] = array(
'SRC' => $arImage['src'],
'WIDTH' => $arImage['width'],
'HEIGHT' => $arImage['height'],
'DESCRIPTION' => $arProps['IMAGES']['DESCRIPTION'][$key],
);
}
}
}
}
$arResult['ITEM']['MORE_PHOTO'] = $arImages;
unset($item, $arImage, $arImages);
<? 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>
<?
}
<? 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>
<?
}
$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'] != '';
function formatPrice($m) {
return $m[1].number_format($m[2], 0, '.', ' ').' р.'.$m[3];
}
$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] = preg_replace_callback('/^(\D*)(\d*)(\D*)$/', 'formatPrice', $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 $priceCode => $productPrice):?>
<div class="price_<?=strtolower($priceCode);?>"><?=$productPrice;?></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>
<?
}