Fetch()) { $hlblockList[$hlblockArr["TABLE_NAME"]] = $hlblockArr; } } $iblockProperties = [ 'article' => 'article', 'manufacturer' => 'manufacturer', 'color' => 'color', 'weight' => 'weight', 'size' => 'size', 'length' => 'length', 'width' => 'width', 'height' => 'height', ]; $iblockPropertySku = []; $iblockPropertySkuHl = []; $iblockPropertyUnitSku = []; $iblockPropertyProduct = []; $iblockPropertyProductHl = []; $iblockPropertyUnitProduct = []; foreach ($iblockProperties as $prop) { $skuUnitProps = ('iblockPropertyUnitSku_' . $prop); $skuUnitProps = $$skuUnitProps; if (is_array($skuUnitProps)) { foreach ($skuUnitProps as $iblock => $val) { $iblockPropertyUnitSku[$iblock][$prop] = $val; } } $skuProps = ('iblockPropertySku_' . $prop); $skuProps = $$skuProps; if (is_array($skuProps)) { foreach ($skuProps as $iblock => $val) { $iblockPropertySku[$iblock][$prop] = $val; } } if ($hlblockModule === true) { foreach ($hlblockList as $hlblockTable => $hlblock) { $hbProps = ('highloadblock' . $hlblockTable . '_' . $prop); $hbProps = $$hbProps; if (is_array($hbProps)) { foreach ($hbProps as $iblock => $val) { $iblockPropertySkuHl[$hlblockTable][$iblock][$prop] = $val; } } } } $productUnitProps = 'iblockPropertyUnitProduct_' . $prop; $productUnitProps = $$productUnitProps; if (is_array($productUnitProps)) { foreach ($productUnitProps as $iblock => $val) { $iblockPropertyUnitProduct[$iblock][$prop] = $val; } } $productProps = "iblockPropertyProduct_" . $prop; $productProps = $$productProps; if (is_array($productProps)) { foreach ($productProps as $iblock => $val) { $iblockPropertyProduct[$iblock][$prop] = $val; } } if ($hlblockModule === true) { foreach ($hlblockList as $hlblockTable => $hlblock) { $hbProps = ('highloadblock_product' . $hlblockTable . '_' . $prop); $hbProps = $$hbProps; if (is_array($hbProps)) { foreach ($hbProps as $iblock => $val) { $iblockPropertyProductHl[$hlblockTable][$iblock][$prop] = $val; } } } } } $productPictures = []; if (is_array($iblockPropertyProduct_picture)) { foreach ($iblockPropertyProduct_picture as $key => $value) { $productPictures[$key] = $value; } } $skuPictures = []; if (is_array($iblockPropertySku_picture)) { foreach ($iblockPropertySku_picture as $key => $value) { $skuPictures[$key] = $value; } } $xmlProps = new XmlSetupPropsCategories( new XmlSetupProps($iblockPropertyProduct, $iblockPropertyUnitProduct, $productPictures), new XmlSetupProps($iblockPropertySku, $iblockPropertyUnitSku, $skuPictures) ); if ($hlblockModule === true) { $xmlProps->highloadblockSku = $iblockPropertySkuHl; $xmlProps->highloadblockProduct = $iblockPropertyProductHl; } $fileSetup = new XmlSetup($xmlProps); $fileSetup->profileId = $profile_id; $fileSetup->iblocksForExport = $iblockExport; $fileSetup->maxOffersValue = $maxOffersValue ?? null; $fileSetup->filePath = $SETUP_FILE_NAME; $fileSetup->loadPurchasePrice = $loadPurchasePrice === 'Y'; $fileSetup->basePriceId = CatalogRepository::getBasePriceId($fileSetup->profileId); $logger = Logger::getInstance('/bitrix/catalog_export/'); if (!is_array($fileSetup->iblocksForExport) || count($fileSetup->iblocksForExport) === 0) { $logger->write(GetMessage("IBLOCK_NOT_SELECTED"), 'i_crm_load_log'); } else { $loader = new IcmlDirector($fileSetup, $logger); $loader->generateXml(); } }