33 $this->vk = Vk\Vk::getInstance();
35 if (!$this->vk->isActive())
46 if (!Loader::includeModule(
'catalog'))
47 throw new SystemException(
"Can't include module \"Catalog\"! " . __METHOD__);
51 $sectionsToExport = $sectionsList->getSectionsToProductExport();
53 if(!empty($sectionsToExport))
55 $logger->addLog(
'Sections to export', $sectionsToExport);
57 $iblockIds = $sectionsList->getMappedIblocks();
60 if (empty($sectionsToExport))
62 $logger->addError(
'EMPTY_SECTIONS_LIST');
66 foreach ($iblockIds as $iblockId)
68 $exportOfferParams = array(
69 "IBLOCK_ID" => $iblockId,
70 "PRODUCT_GROUPS" => $sectionsToExport[$iblockId],
71 "INCLUDE_SUBSECTION" =>
false
74 if (isset($this->startPosition[$iblockId]))
76 $exportOfferParams[
"START_POSITION"] = $this->startPosition[$iblockId];
77 $this->startFeed = count($this->feeds);
81 if($this->vk->getAvailableFlag($this->exportId))
82 $feed->setOnlyAvailableFlag(
true);
84 $this->feeds[] = $feed;