1
0
mirror of synced 2024-11-30 09:16:06 +03:00
bitrix-module/intaro.intarocrm/export/export_run.php

65 lines
1.9 KiB
PHP
Raw Normal View History

2013-09-12 17:31:32 +04:00
<?php
set_time_limit(0);
global $APPLICATION;
if (!CModule::IncludeModule("iblock"))
return;
if (!CModule::IncludeModule("catalog"))
return;
if (!CModule::IncludeModule("intaro.intarocrm"))
return;
2013-10-02 17:42:20 +04:00
$iblockProperties = Array(
"article" => "article",
"manufacturer" => "manufacturer",
"color" =>"color",
"weight" => "weight",
"size" => "size",
2014-01-23 16:55:04 +04:00
"length" => "length",
"width" => "width",
"height" => "height",
2013-10-02 17:42:20 +04:00
);
$IBLOCK_PROPERTY_SKU = array();
2014-01-23 16:55:04 +04:00
$IBLOCK_PROPERTY_UNIT_SKU = array();
2013-10-02 17:42:20 +04:00
foreach ($iblockProperties as $prop) {
2014-01-23 16:55:04 +04:00
$skuUnitProps = ('IBLOCK_PROPERTY_UNIT_SKU' . "_" . $prop);
$skuUnitProps = $$skuUnitProps;
foreach ($skuUnitProps as $iblock => $val) {
$IBLOCK_PROPERTY_UNIT_SKU[$iblock][$prop] = $val;
}
2013-10-02 17:42:20 +04:00
$skuProps = ('IBLOCK_PROPERTY_SKU' . "_" . $prop);
$skuProps = $$skuProps;
foreach ($skuProps as $iblock => $val) {
$IBLOCK_PROPERTY_SKU[$iblock][$prop] = $val;
}
}
$IBLOCK_PROPERTY_PRODUCT = array();
2014-01-23 16:55:04 +04:00
$IBLOCK_PROPERTY_UNIT_PRODUCT = array();
2013-10-02 17:42:20 +04:00
foreach ($iblockProperties as $prop) {
2014-01-23 16:55:04 +04:00
$productUnitProps = "IBLOCK_PROPERTY_UNIT_PRODUCT" . "_" . $prop;
$productUnitProps = $$productUnitProps;
foreach ($productUnitProps as $iblock => $val) {
$IBLOCK_PROPERTY_UNIT_PRODUCT[$iblock][$prop] = $val;
}
$productProps = "IBLOCK_PROPERTY_PRODUCT" . "_" . $prop;
$productProps = $$productProps;
foreach ($productProps as $iblock => $val) {
2013-10-02 17:42:20 +04:00
$IBLOCK_PROPERTY_PRODUCT[$iblock][$prop] = $val;
}
}
2013-09-12 17:31:32 +04:00
$loader = new ICMLLoader();
$loader->iblocks = $IBLOCK_EXPORT;
2013-09-13 16:15:54 +04:00
$loader->propertiesSKU = $IBLOCK_PROPERTY_SKU;
2014-01-23 16:55:04 +04:00
$loader->propertiesUnitSKU = $IBLOCK_PROPERTY_UNIT_SKU;
2013-09-13 16:15:54 +04:00
$loader->propertiesProduct = $IBLOCK_PROPERTY_PRODUCT;
2014-01-23 16:55:04 +04:00
$loader->propertiesUnitProduct = $IBLOCK_PROPERTY_UNIT_PRODUCT;
2013-09-12 17:31:32 +04:00
$loader->filename = $SETUP_FILE_NAME;
$loader->application = $APPLICATION;
$loader->Load();