This commit is contained in:
Bellord
2026-10-01 16:18:32 +03:00
parent 4d3eda33fb
commit aac75b3752
2 changed files with 20 additions and 3 deletions
+13 -1
View File
@@ -5,7 +5,7 @@ namespace Ixrs\Catalog\Support;
class ElementList
{
public static function getGlobalFilter($iBlockId, $globalFilter)
public static function getGlobalFilter($iBlockId, $globalFilter, &$offersFilter = [])
{
$pFilter = [];
$af = app()->factory()->iBlock()->getEntityById($iBlockId);
@@ -141,6 +141,18 @@ class ElementList
// $this->storage['SUB_FILTER'][$fKey] = $values;
// }
//}
$offersFilter = is_array($globalFilter['OFFERS'])?$globalFilter['OFFERS']:[];
foreach ($oFilter as $fKey => $values) {
if(isset($offersFilter[$fKey])){
$offersFilter[$fKey] =
collect((array)$offersFilter[$fKey])->merge($values)->unique()->toArray();
}
else {
$offersFilter[$fKey] = $values;
}
}
}
return $globalFilter;
}