Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
productsettings.php
1<?php
2
4
7use CCatalogSku;
8
9Loader::requireModule('iblock');
10
12{
13 private ?int $offersIblockId = null;
14 private ?int $skuPropertyId = null;
15
16 protected function init(): void
17 {
18 parent::init();
19
20 $catalog = CCatalogSku::GetInfoByIBlock($this->getIblockId());
21 if (!empty($catalog))
22 {
23 $type = $catalog['CATALOG_TYPE'];
24
25 if (
26 $type === CCatalogSku::TYPE_FULL
27 || $type === CCatalogSku::TYPE_PRODUCT
28 )
29 {
30 $this->offersIblockId = $catalog['IBLOCK_ID'];
31 $this->skuPropertyId = $catalog['SKU_PROPERTY_ID'];
32 }
33 }
34 }
35
36 public function isAllowedIblockSections(): bool
37 {
38 return false;
39 }
40
41 public function getOffersIblockId(): ?int
42 {
43 return $this->offersIblockId;
44 }
45
46 public function getSkuPropertyId(): ?int
47 {
48 return $this->skuPropertyId;
49 }
50}