17 new ActionFilter\CloseSession(),
20 ActionFilter\Authentication::class,
23 'getIblockProperties' => [
25 ActionFilter\Authentication::class,
33 parent::getDefaultPreFilters(),
35 new ActionFilter\
HttpMethod([ActionFilter\HttpMethod::METHOD_POST]),
36 new ActionFilter\
Scope(ActionFilter\Scope::AJAX),
48 $skuTree = ServiceContainer::make(
'sku.tree', [
'iblockId' => $iblockId]);
51 return $skuTree->getTreeProperties();
57 public function getSkuAction(
int $skuId): array
59 $iterator = \CIBlockElement::GetList(
65 'CHECK_PERMISSIONS' =>
'Y',
66 'MIN_PERMISSION' =>
'R',
72 $element = $iterator->Fetch();
79 $skuRepository = ServiceContainer::getSkuRepository($element[
'IBLOCK_ID']);
86 $sku = $skuRepository->getEntityById($skuId);
88 if (!$sku || $sku->isSimple())
93 $parentProduct = $sku->getParent();
100 $skuTree = ServiceContainer::make(
'sku.tree', [
101 'iblockId' => $parentProduct->getIblockId(),
111 $offers = $skuTree->loadWithSelectedOffers([
112 $productId => $skuId,
115 if ($offers[$productId][$skuId] && is_array($offers[$productId][$skuId][
'OFFERS']))
117 foreach ($offers[$productId][$skuId][
'OFFERS'] as $offer)
119 if ((
int)$offer[
'ID'] === $skuId)
121 unset($offer[
'DISPLAY_PROPERTIES'], $offer[
'PROPERTIES']);