77 lines
2.2 KiB
PHP
77 lines
2.2 KiB
PHP
<?php
|
|
if (!defined('B_PROLOG_INCLUDED') || B_PROLOG_INCLUDED !== true) {
|
|
exit;
|
|
}
|
|
|
|
// options from TSolution\Functions::showBlockHtml
|
|
|
|
$arOptions = $arConfig['PARAMS'];
|
|
$arItem = $arConfig['ITEM'];
|
|
$itemProps = $arItem['CHARACTERISTICS'] ?: $arItem['PROPS'];
|
|
|
|
$view = match($arConfig['VIEW']) {
|
|
'detail' => 'detail',
|
|
'table' => 'table',
|
|
default => 'list',
|
|
};
|
|
|
|
$propIterator = 0;
|
|
$maxVisibleProps = $arOptions['VISIBLE_PROP_COUNT'] ?? PHP_INT_MAX;
|
|
|
|
$wrapperClassList = ['properties properties__container js-offers-prop'];
|
|
if ($arOptions['WRAPPER_CLASSES']) {
|
|
$wrapperClassList[] = $arOptions['WRAPPER_CLASSES'];
|
|
}
|
|
|
|
$wrapperClassList = TSolution\Utils::implodeClasses($wrapperClassList);
|
|
?>
|
|
<div class="<?=$wrapperClassList;?>"<?=$arOptions['VISIBLE_PROP_COUNT'] ? ' data-visible_prop_count="'.$arOptions['VISIBLE_PROP_COUNT'].'"' : '';?>>
|
|
<?if ($arOptions['TITLE']):?>
|
|
<div class="char-side__title font_15 color_222">
|
|
<?=$arOptions['TITLE'];?>
|
|
</div>
|
|
<?endif;?>
|
|
|
|
<?php
|
|
if ($itemProps) {
|
|
foreach ($itemProps as $arProp) {
|
|
if (empty($arProp['VALUE'])) {
|
|
continue;
|
|
}
|
|
if ($propIterator >= $maxVisibleProps) {
|
|
break;
|
|
}
|
|
|
|
TSolution\Functions::showBlockHtml([
|
|
'FILE' => 'product/props_catalog_'.$view.'.php',
|
|
'PROP_TITLE' => $arProp['NAME'],
|
|
'PROP_VALUE' => is_array($arProp['VALUE']) ? implode(', ', $arProp['VALUE']) : $arProp['VALUE'],
|
|
'PARAMS' => array_merge($arOptions, ['ITEM_PROP' => true]),
|
|
]);
|
|
|
|
++$propIterator;
|
|
}
|
|
}
|
|
|
|
if ($arItem['OFFER_PROP']) {
|
|
foreach ($arItem['OFFER_PROP'] as $arProp) {
|
|
if (empty($arProp['VALUE'])) {
|
|
continue;
|
|
}
|
|
if ($propIterator >= $maxVisibleProps) {
|
|
break;
|
|
}
|
|
|
|
TSolution\Functions::showBlockHtml([
|
|
'FILE' => 'product/props_catalog_'.$view.'.php',
|
|
'PROP_TITLE' => $arProp['NAME'],
|
|
'PROP_VALUE' => is_array($arProp['VALUE']) ? implode(', ', $arProp['VALUE']) : $arProp['VALUE'],
|
|
'PARAMS' => $arOptions,
|
|
]);
|
|
|
|
++$propIterator;
|
|
}
|
|
}
|
|
?>
|
|
</div>
|