1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
search.php
См. документацию.
1
<?php
2
namespace
Bitrix\Catalog\Product;
3
4
use Bitrix\Catalog,
5
Bitrix\Iblock;
6
13
class
Search
14
{
15
protected
static
$catalogList
=
array
();
16
23
public
static
function
onBeforeIndex
(
$fields
)
24
{
25
if
(!isset(
$fields
[
'MODULE_ID'
]) ||
$fields
[
'MODULE_ID'
] !=
'iblock'
)
26
return
$fields
;
27
if
(empty(
$fields
[
'PARAM2'
]))
28
return
$fields
;
29
30
if
(!isset(self::$catalogList[
$fields
[
'PARAM2'
]]))
31
{
32
self::$catalogList[
$fields
[
'PARAM2'
]] =
false
;
33
$catalog
=
Catalog\CatalogIblockTable::getList
(
array
(
34
'select'
=>
array
(
'IBLOCK_ID'
),
35
'filter'
=>
array
(
'=IBLOCK_ID'
=>
$fields
[
'PARAM2'
])
36
))->fetch();
37
if
(!empty(
$catalog
))
38
self::$catalogList[
$fields
[
'PARAM2'
]] =
$catalog
[
'IBLOCK_ID'
];
39
unset(
$catalog
);
40
}
41
42
if
(!empty(self::$catalogList[
$fields
[
'PARAM2'
]]) && isset(
$fields
[
'ITEM_ID'
]))
43
{
44
$fields
[
'PARAMS'
][
'iblock_section'
] =
array
();
45
if
(mb_strpos(
$fields
[
'ITEM_ID'
],
'S'
) ===
false
)
46
{
47
$sections = Iblock\SectionElementTable::getList(
array
(
48
'select'
=>
array
(
'IBLOCK_SECTION_ID'
),
49
'filter'
=>
array
(
'=IBLOCK_ELEMENT_ID'
=>
$fields
[
'ITEM_ID'
],
'=ADDITIONAL_PROPERTY_ID'
=>
null
)
50
));
51
while
($section = $sections->fetch())
52
{
54
$nav = \CIBlockSection::getNavChain(
$fields
[
'PARAM2'
], $section[
'IBLOCK_SECTION_ID'
],
array
(
'ID'
));
55
while
($chain = $nav->fetch())
56
$fields
[
'PARAMS'
][
'iblock_section'
][$chain[
'ID'
]] = $chain[
'ID'
];
57
unset($chain, $nav);
58
}
59
unset($section, $sections);
60
}
61
else
62
{
64
$nav = \CIBlockSection::getNavChain(
$fields
[
'PARAM2'
], preg_replace(
'#[^0-9]+#'
,
''
,
$fields
[
"ITEM_ID"
]),
array
(
'ID'
));
65
while
($chain = $nav->fetch())
66
$fields
[
'PARAMS'
][
'iblock_section'
][$chain[
'ID'
]] = $chain[
'ID'
];
67
unset($chain, $nav);
68
}
69
if
(!empty(
$fields
[
'PARAMS'
][
'iblock_section'
]))
70
$fields
[
'PARAMS'
][
'iblock_section'
] = array_values(
$fields
[
'PARAMS'
][
'iblock_section'
]);
71
}
72
return
$fields
;
73
}
74
}
Bitrix\Catalog\Product\Search\$catalogList
static $catalogList
Определения
search.php:15
Bitrix\Catalog\Product\Search\onBeforeIndex
static onBeforeIndex($fields)
Определения
search.php:23
Bitrix\Main\ORM\Data\DataManager\getList
static getList(array $parameters=array())
Определения
datamanager.php:431
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$catalog
$catalog
Определения
iblock_catalog_edit.php:135
Bitrix\Main\Search
Определения
content.php:3
$fields
$fields
Определения
yandex_run.php:501
bitrix
modules
catalog
lib
product
search.php
Создано системой
1.14.0