commit
7fd94ccd6e
@ -1,3 +1,9 @@
|
|||||||
|
## 2018-10-04 v.2.3.11
|
||||||
|
* Добавлен учет настроек часового пояса при создании заказа
|
||||||
|
* Устранено удаление событий изменения оплат при переводе выгрузки на агент
|
||||||
|
* Добавлена возможность указать свойство в настройках экспорта, из которого будет подставляться картинка, если отсутствует в "Подробно" и "Анонс"
|
||||||
|
* Добавлена подстановка домена в ссылках каталога в зависимости от пренадлежности инфоблока к сайту
|
||||||
|
|
||||||
## 2018-09-26 v.2.3.10
|
## 2018-09-26 v.2.3.10
|
||||||
* Исправлена некорректная генерация скрипта UA
|
* Исправлена некорректная генерация скрипта UA
|
||||||
* Исправлена выгрузка остатков, если для товара указано более 50 складов
|
* Исправлена выгрузка остатков, если для товара указано более 50 складов
|
||||||
|
@ -10,6 +10,7 @@ class RetailCrmICML
|
|||||||
public $iblocks;
|
public $iblocks;
|
||||||
public $filename;
|
public $filename;
|
||||||
public $serverName;
|
public $serverName;
|
||||||
|
public $defaultServerName;
|
||||||
public $propertiesSKU;
|
public $propertiesSKU;
|
||||||
public $propertiesUnitSKU;
|
public $propertiesUnitSKU;
|
||||||
public $propertiesProduct;
|
public $propertiesProduct;
|
||||||
@ -20,6 +21,8 @@ class RetailCrmICML
|
|||||||
public $encoding = 'utf-8';
|
public $encoding = 'utf-8';
|
||||||
public $encodingDefault = 'utf-8';
|
public $encodingDefault = 'utf-8';
|
||||||
public $loadPurchasePrice = false;
|
public $loadPurchasePrice = false;
|
||||||
|
public $productPictures;
|
||||||
|
public $skuPictures;
|
||||||
|
|
||||||
protected $fp;
|
protected $fp;
|
||||||
protected $mainSection = 1000000;
|
protected $mainSection = 1000000;
|
||||||
@ -245,7 +248,6 @@ class RetailCrmICML
|
|||||||
|
|
||||||
protected function BuildOffers(&$allCategories)
|
protected function BuildOffers(&$allCategories)
|
||||||
{
|
{
|
||||||
|
|
||||||
$basePriceId = COption::GetOptionString(
|
$basePriceId = COption::GetOptionString(
|
||||||
$this->MODULE_ID,
|
$this->MODULE_ID,
|
||||||
$this->CRM_CATALOG_BASE_PRICE . (is_null($this->profileID) === false ? '_' . $this->profileID : ''),
|
$this->CRM_CATALOG_BASE_PRICE . (is_null($this->profileID) === false ? '_' . $this->profileID : ''),
|
||||||
@ -253,7 +255,16 @@ class RetailCrmICML
|
|||||||
);
|
);
|
||||||
|
|
||||||
foreach ($this->iblocks as $key => $id) {
|
foreach ($this->iblocks as $key => $id) {
|
||||||
|
$site = CAllIBlock::GetSite($id)->Fetch();
|
||||||
|
|
||||||
|
if ($site['SERVER_NAME']) {
|
||||||
|
$this->serverName = $site['SERVER_NAME'];
|
||||||
|
} else {
|
||||||
|
$this->serverName = $this->defaultServerName;
|
||||||
|
}
|
||||||
|
|
||||||
$barcodes = array();
|
$barcodes = array();
|
||||||
|
|
||||||
$dbBarCode = CCatalogStoreBarCode::getList(
|
$dbBarCode = CCatalogStoreBarCode::getList(
|
||||||
array(),
|
array(),
|
||||||
array("IBLOCK_ID" => $id),
|
array("IBLOCK_ID" => $id),
|
||||||
@ -270,8 +281,8 @@ class RetailCrmICML
|
|||||||
|
|
||||||
$highloadblockSkuProps = array();
|
$highloadblockSkuProps = array();
|
||||||
$highloadblockProductProps = array();
|
$highloadblockProductProps = array();
|
||||||
|
|
||||||
$productProps = CIBlockproperty::GetList(array(), array("IBLOCK_ID" => $id));
|
$productProps = CIBlockproperty::GetList(array(), array("IBLOCK_ID" => $id));
|
||||||
|
|
||||||
while ($arrProductProps = $productProps->Fetch()) {
|
while ($arrProductProps = $productProps->Fetch()) {
|
||||||
|
|
||||||
if ($arrProductProps["USER_TYPE"] == 'directory') {
|
if ($arrProductProps["USER_TYPE"] == 'directory') {
|
||||||
@ -282,10 +293,9 @@ class RetailCrmICML
|
|||||||
// Get Info by infoblocks
|
// Get Info by infoblocks
|
||||||
$iblock['IBLOCK_DB'] = CIBlock::GetByID($id)->Fetch();
|
$iblock['IBLOCK_DB'] = CIBlock::GetByID($id)->Fetch();
|
||||||
$iblockOffer = CCatalogSKU::GetInfoByProductIBlock($id);
|
$iblockOffer = CCatalogSKU::GetInfoByProductIBlock($id);
|
||||||
|
|
||||||
$skuProps = CIBlockproperty::GetList(array(), array("IBLOCK_ID" => $iblockOffer['IBLOCK_ID']));
|
$skuProps = CIBlockproperty::GetList(array(), array("IBLOCK_ID" => $iblockOffer['IBLOCK_ID']));
|
||||||
while ($arrSkuProps = $skuProps->Fetch()) {
|
|
||||||
|
|
||||||
|
while ($arrSkuProps = $skuProps->Fetch()) {
|
||||||
if ($arrSkuProps["USER_TYPE"] == 'directory') {
|
if ($arrSkuProps["USER_TYPE"] == 'directory') {
|
||||||
$highloadblockSkuProps[$arrSkuProps['CODE']] = $arrSkuProps;
|
$highloadblockSkuProps[$arrSkuProps['CODE']] = $arrSkuProps;
|
||||||
}
|
}
|
||||||
@ -311,14 +321,21 @@ class RetailCrmICML
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($this->productPictures && isset($this->productPictures[$id])) {
|
||||||
|
$arSelect[] = "PROPERTY_" . $this->productPictures[$id]['picture'];
|
||||||
|
$arSelect[] = "PROPERTY_" . $this->productPictures[$id]['picture'] . ".NAME";
|
||||||
|
}
|
||||||
|
|
||||||
$arSelectOffer = array(
|
$arSelectOffer = array(
|
||||||
'ID',
|
'ID',
|
||||||
"NAME",
|
"NAME",
|
||||||
"DETAIL_PAGE_URL",
|
"DETAIL_PAGE_URL",
|
||||||
"DETAIL_PICTURE",
|
"DETAIL_PICTURE",
|
||||||
|
"PREVIEW_PICTURE",
|
||||||
'PROPERTY_' . $iblockOffer['SKU_PROPERTY_ID'],
|
'PROPERTY_' . $iblockOffer['SKU_PROPERTY_ID'],
|
||||||
"CATALOG_GROUP_" . $basePriceId
|
"CATALOG_GROUP_" . $basePriceId
|
||||||
);
|
);
|
||||||
|
|
||||||
// Set selected properties
|
// Set selected properties
|
||||||
foreach ($this->propertiesSKU[$id] as $key => $propSKU) {
|
foreach ($this->propertiesSKU[$id] as $key => $propSKU) {
|
||||||
if ($this->propertiesSKU[$id][$key] != "") {
|
if ($this->propertiesSKU[$id][$key] != "") {
|
||||||
@ -327,6 +344,11 @@ class RetailCrmICML
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($this->skuPictures && isset($this->skuPictures[$id])) {
|
||||||
|
$arSelectOffer[] = "PROPERTY_" . $this->skuPictures[$id]['picture'];
|
||||||
|
$arSelectOffer[] = "PROPERTY_" . $this->skuPictures[$id]['picture'] . ".NAME";
|
||||||
|
}
|
||||||
|
|
||||||
// Set filter
|
// Set filter
|
||||||
$filter = array(
|
$filter = array(
|
||||||
"IBLOCK_ID" => $id
|
"IBLOCK_ID" => $id
|
||||||
@ -352,40 +374,16 @@ class RetailCrmICML
|
|||||||
|
|
||||||
$dbResProducts = CIBlockElement::GetList($order, $arfilter, false, false, $arSelect);
|
$dbResProducts = CIBlockElement::GetList($order, $arfilter, false, false, $arSelect);
|
||||||
|
|
||||||
$pictures = array();
|
|
||||||
$products = array();
|
$products = array();
|
||||||
|
|
||||||
while ($product = $dbResProducts->GetNext()) {
|
while ($product = $dbResProducts->GetNext()) {
|
||||||
// Compile products to array
|
// Compile products to array
|
||||||
$products[$product['ID']] = $product;
|
$products[$product['ID']] = $product;
|
||||||
$products[$product['ID']]['offers'] = array();
|
$products[$product['ID']]['offers'] = array();
|
||||||
|
|
||||||
$detailPicture = intval($product["DETAIL_PICTURE"]);
|
}
|
||||||
$previewPicture = intval($product["PREVIEW_PICTURE"]);
|
|
||||||
|
|
||||||
if ($detailPicture > 0 || $previewPicture > 0) {
|
|
||||||
$picture = $detailPicture;
|
|
||||||
if ($picture <= 0) {
|
|
||||||
$picture = $previewPicture;
|
|
||||||
}
|
|
||||||
// Link pictureID and productID
|
|
||||||
$pictures[$picture] = $product['ID'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
unset($product);
|
unset($product);
|
||||||
unset($detailPicture, $previewPicture, $picture);
|
|
||||||
|
|
||||||
$pictureIDs = array_keys($pictures);
|
|
||||||
|
|
||||||
// Get pathes of pictures
|
|
||||||
$dbFiles = CFile::GetList(array(), array("@ID" => implode(',', $pictureIDs)));
|
|
||||||
while ($file = $dbFiles->GetNext()) {
|
|
||||||
// Link picture to product
|
|
||||||
$products[$pictures[$file['ID']]]['PICTURE'] = $this->protocol .
|
|
||||||
$this->serverName .
|
|
||||||
'/upload/' . $file['SUBDIR'] .
|
|
||||||
'/' . $file['FILE_NAME'] ;
|
|
||||||
}
|
|
||||||
unset($pictures);
|
|
||||||
|
|
||||||
if (!empty($iblockOffer['IBLOCK_ID'])) {
|
if (!empty($iblockOffer['IBLOCK_ID'])) {
|
||||||
$arFilterOffer = array(
|
$arFilterOffer = array(
|
||||||
@ -411,6 +409,19 @@ class RetailCrmICML
|
|||||||
|
|
||||||
$stringOffers = "";
|
$stringOffers = "";
|
||||||
foreach ($products as $product) {
|
foreach ($products as $product) {
|
||||||
|
if (CFile::GetPath($product["DETAIL_PICTURE"])) {
|
||||||
|
$product['PICTURE'] = $this->protocol . $this->serverName . CFile::GetPath($product["DETAIL_PICTURE"]);
|
||||||
|
} elseif (CFile::GetPath($product["PREVIEW_PICTURE"])){
|
||||||
|
$product['PICTURE'] = $this->protocol . $this->serverName . CFile::GetPath($product["PREVIEW_PICTURE"]);
|
||||||
|
} elseif (
|
||||||
|
$this->productPictures
|
||||||
|
&& isset($this->productPictures[$id])
|
||||||
|
&& CFile::GetPath($product["PROPERTY_" . $this->productPictures[$id]['picture'] . "_VALUE"])
|
||||||
|
) {
|
||||||
|
$picture = CFile::GetPath($product["PROPERTY_" . $this->productPictures[$id]['picture'] . "_VALUE"]);
|
||||||
|
$product['PICTURE'] = $this->protocol . $this->serverName . $picture;
|
||||||
|
}
|
||||||
|
|
||||||
// Get properties of product
|
// Get properties of product
|
||||||
$resPropertiesProduct = Array();
|
$resPropertiesProduct = Array();
|
||||||
foreach ($this->propertiesProduct[$id] as $key => $propProduct) {
|
foreach ($this->propertiesProduct[$id] as $key => $propProduct) {
|
||||||
@ -424,14 +435,16 @@ class RetailCrmICML
|
|||||||
} elseif (isset($product[$propProduct])) {
|
} elseif (isset($product[$propProduct])) {
|
||||||
$resPropertiesProduct[$key] = $product[$propProduct];
|
$resPropertiesProduct[$key] = $product[$propProduct];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists($key, $this->propertiesUnitProduct[$id])) {
|
if (array_key_exists($key, $this->propertiesUnitProduct[$id])) {
|
||||||
$resPropertiesProduct[$key] *= $this->measurement[$this->propertiesUnitProduct[$id][$key]];
|
$resPropertiesProduct[$key] *= $this->measurement[$this->propertiesUnitProduct[$id][$key]];
|
||||||
$resPropertiesProduct[$key . "_UNIT"] = $this->measurementLink[$this->propertiesUnitProduct[$id][$key]];
|
$resPropertiesProduct[$key . "_UNIT"] = $this->measurementLink[$this->propertiesUnitProduct[$id][$key]];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($highloadblockProductProps[$propProduct])) {
|
if (isset($highloadblockProductProps[$propProduct])) {
|
||||||
$propVal = $this->getHBprop($highloadblockProductProps[$propProduct], $product["PROPERTY_" . $propProduct . "_VALUE"]);
|
$propVal = $this->getHBprop($highloadblockProductProps[$propProduct], $product["PROPERTY_" . $propProduct . "_VALUE"]);
|
||||||
$tableName = $highloadblockProductProps[$propProduct]['USER_TYPE_SETTINGS']['TABLE_NAME'];
|
$tableName = $highloadblockProductProps[$propProduct]['USER_TYPE_SETTINGS']['TABLE_NAME'];
|
||||||
$field = $this->highloadblockProductProperties[$tableName][$iblockOffer['IBLOCK_ID']][$key];
|
$field = $this->highloadblockProductProperties[$tableName][$id][$key];
|
||||||
|
|
||||||
$resPropertiesProduct[$key] = $propVal[$field];
|
$resPropertiesProduct[$key] = $propVal[$field];
|
||||||
}
|
}
|
||||||
@ -461,8 +474,17 @@ class RetailCrmICML
|
|||||||
|
|
||||||
if (CFile::GetPath($offer["DETAIL_PICTURE"])) {
|
if (CFile::GetPath($offer["DETAIL_PICTURE"])) {
|
||||||
$offer['PICTURE'] = $this->protocol . $this->serverName . CFile::GetPath($offer["DETAIL_PICTURE"]);
|
$offer['PICTURE'] = $this->protocol . $this->serverName . CFile::GetPath($offer["DETAIL_PICTURE"]);
|
||||||
|
} elseif (CFile::GetPath($offer["PREVIEW_PICTURE"])){
|
||||||
|
$offer['PICTURE'] = $this->protocol . $this->serverName . CFile::GetPath($offer["PREVIEW_PICTURE"]);
|
||||||
|
} elseif (
|
||||||
|
$this->skuPictures
|
||||||
|
&& isset($this->skuPictures[$id])
|
||||||
|
&& CFile::GetPath($offer["PROPERTY_" . $this->skuPictures[$id]['picture'] . "_VALUE"])
|
||||||
|
) {
|
||||||
|
$picture = CFile::GetPath($offer["PROPERTY_" . $this->skuPictures[$id]['picture'] . "_VALUE"]);
|
||||||
|
$offer['PICTURE'] = $this->protocol . $this->serverName . $picture;
|
||||||
} else {
|
} else {
|
||||||
$offer['PICTURE'] = $product["PICTURE"];
|
$offer['PICTURE'] = $product['PICTURE'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$offer['PRODUCT_NAME'] = $product["NAME"];
|
$offer['PRODUCT_NAME'] = $product["NAME"];
|
||||||
@ -568,7 +590,10 @@ class RetailCrmICML
|
|||||||
$arOffer['DETAIL_PAGE_URL'] = str_replace("#SECTION_PATH#", $path, $arOffer['DETAIL_PAGE_URL']);
|
$arOffer['DETAIL_PAGE_URL'] = str_replace("#SECTION_PATH#", $path, $arOffer['DETAIL_PAGE_URL']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($arOffer["PICTURE"]) && $arOffer["PICTURE"]) {
|
||||||
$offer .= "<picture>" . $this->PrepareValue($arOffer["PICTURE"]) . "</picture>\n";
|
$offer .= "<picture>" . $this->PrepareValue($arOffer["PICTURE"]) . "</picture>\n";
|
||||||
|
}
|
||||||
|
|
||||||
$offer .= "<url>" . $this->protocol . $this->serverName . $this->PrepareValue($arOffer['DETAIL_PAGE_URL']) . "</url>\n";
|
$offer .= "<url>" . $this->protocol . $this->serverName . $this->PrepareValue($arOffer['DETAIL_PAGE_URL']) . "</url>\n";
|
||||||
|
|
||||||
$offer .= "<price>" . $this->PrepareValue($arOffer['PRICE']) . "</price>\n";
|
$offer .= "<price>" . $this->PrepareValue($arOffer['PRICE']) . "</price>\n";
|
||||||
|
@ -47,7 +47,7 @@ class RetailCrmOrder
|
|||||||
$order = array(
|
$order = array(
|
||||||
'number' => $arFields['NUMBER'],
|
'number' => $arFields['NUMBER'],
|
||||||
'externalId' => $arFields['ID'],
|
'externalId' => $arFields['ID'],
|
||||||
'createdAt' => new \DateTime($arFields['DATE_INSERT']),
|
'createdAt' => $arFields['DATE_INSERT'],
|
||||||
'customer' => array('externalId' => $arFields['USER_ID']),
|
'customer' => array('externalId' => $arFields['USER_ID']),
|
||||||
'paymentType' => isset($arParams['optionsPayTypes'][$arFields['PAYMENTS'][0]]) ?
|
'paymentType' => isset($arParams['optionsPayTypes'][$arFields['PAYMENTS'][0]]) ?
|
||||||
$arParams['optionsPayTypes'][$arFields['PAYMENTS'][0]] : '',
|
$arParams['optionsPayTypes'][$arFields['PAYMENTS'][0]] : '',
|
||||||
@ -321,11 +321,12 @@ class RetailCrmOrder
|
|||||||
|
|
||||||
public static function orderObjToArr($obOrder)
|
public static function orderObjToArr($obOrder)
|
||||||
{
|
{
|
||||||
|
$culture = new \Bitrix\Main\Context\Culture(array("FORMAT_DATETIME" => "Y-m-d HH:i:s"));
|
||||||
$arOrder = array(
|
$arOrder = array(
|
||||||
'ID' => $obOrder->getId(),
|
'ID' => $obOrder->getId(),
|
||||||
'NUMBER' => $obOrder->getField('ACCOUNT_NUMBER'),
|
'NUMBER' => $obOrder->getField('ACCOUNT_NUMBER'),
|
||||||
'LID' => $obOrder->getSiteId(),
|
'LID' => $obOrder->getSiteId(),
|
||||||
'DATE_INSERT' => $obOrder->getDateInsert(),
|
'DATE_INSERT' => $obOrder->getDateInsert()->toString($culture),
|
||||||
'STATUS_ID' => $obOrder->getField('STATUS_ID'),
|
'STATUS_ID' => $obOrder->getField('STATUS_ID'),
|
||||||
'USER_ID' => $obOrder->getUserId(),
|
'USER_ID' => $obOrder->getUserId(),
|
||||||
'PERSON_TYPE_ID' => $obOrder->getPersonTypeId(),
|
'PERSON_TYPE_ID' => $obOrder->getPersonTypeId(),
|
||||||
|
@ -50,7 +50,7 @@ class RetailCrmOrder
|
|||||||
$order = array(
|
$order = array(
|
||||||
'number' => $arFields['NUMBER'],
|
'number' => $arFields['NUMBER'],
|
||||||
'externalId' => $arFields['ID'],
|
'externalId' => $arFields['ID'],
|
||||||
'createdAt' => new \DateTime($arFields['DATE_INSERT']),
|
'createdAt' => $arFields['DATE_INSERT'],
|
||||||
'customer' => array('externalId' => $arFields['USER_ID']),
|
'customer' => array('externalId' => $arFields['USER_ID']),
|
||||||
'orderType' => isset($arParams['optionsOrderTypes'][$arFields['PERSON_TYPE_ID']]) ?
|
'orderType' => isset($arParams['optionsOrderTypes'][$arFields['PERSON_TYPE_ID']]) ?
|
||||||
$arParams['optionsOrderTypes'][$arFields['PERSON_TYPE_ID']] : '',
|
$arParams['optionsOrderTypes'][$arFields['PERSON_TYPE_ID']] : '',
|
||||||
@ -202,7 +202,11 @@ class RetailCrmOrder
|
|||||||
}
|
}
|
||||||
$payments[] = $pm;
|
$payments[] = $pm;
|
||||||
} else {
|
} else {
|
||||||
RCrmActions::eventLog('RetailCrmOrder::orderSend', 'payments', 'OrderID = ' . $arFields['ID'] . '. Payment not found.');
|
RCrmActions::eventLog(
|
||||||
|
'RetailCrmOrder::orderSend',
|
||||||
|
'payments',
|
||||||
|
'OrderID = ' . $arFields['ID'] . '. Payment not found.'
|
||||||
|
);
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -217,7 +221,11 @@ class RetailCrmOrder
|
|||||||
if (is_array($newResOrder) && !empty($newResOrder)) {
|
if (is_array($newResOrder) && !empty($newResOrder)) {
|
||||||
$order = $newResOrder;
|
$order = $newResOrder;
|
||||||
} elseif ($newResOrder === false) {
|
} elseif ($newResOrder === false) {
|
||||||
RCrmActions::eventLog('RetailCrmOrder::orderSend', 'retailCrmBeforeOrderSend()', 'OrderID = ' . $arFields['ID'] . '. Sending canceled after retailCrmBeforeOrderSend');
|
RCrmActions::eventLog(
|
||||||
|
'RetailCrmOrder::orderSend',
|
||||||
|
'retailCrmBeforeOrderSend()',
|
||||||
|
'OrderID = ' . $arFields['ID'] . '. Sending canceled after retailCrmBeforeOrderSend'
|
||||||
|
);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -384,11 +392,12 @@ class RetailCrmOrder
|
|||||||
|
|
||||||
public static function orderObjToArr($obOrder)
|
public static function orderObjToArr($obOrder)
|
||||||
{
|
{
|
||||||
|
$culture = new \Bitrix\Main\Context\Culture(array("FORMAT_DATETIME" => "Y-m-d HH:i:s"));
|
||||||
$arOrder = array(
|
$arOrder = array(
|
||||||
'ID' => $obOrder->getId(),
|
'ID' => $obOrder->getId(),
|
||||||
'NUMBER' => $obOrder->getField('ACCOUNT_NUMBER'),
|
'NUMBER' => $obOrder->getField('ACCOUNT_NUMBER'),
|
||||||
'LID' => $obOrder->getSiteId(),
|
'LID' => $obOrder->getSiteId(),
|
||||||
'DATE_INSERT' => $obOrder->getDateInsert(),
|
'DATE_INSERT' => $obOrder->getDateInsert()->toString($culture),
|
||||||
'STATUS_ID' => $obOrder->getField('STATUS_ID'),
|
'STATUS_ID' => $obOrder->getField('STATUS_ID'),
|
||||||
'USER_ID' => $obOrder->getUserId(),
|
'USER_ID' => $obOrder->getUserId(),
|
||||||
'PERSON_TYPE_ID' => $obOrder->getPersonTypeId(),
|
'PERSON_TYPE_ID' => $obOrder->getPersonTypeId(),
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
- Исправлена некорректная генерация скрипта UA
|
- Добавлен учет настроек часового пояса при создании заказа
|
||||||
- Улучшена выгрузка остатков по складам в retailCRM
|
- Устранено удаление событий изменения оплат при переводе выгрузки на агент
|
||||||
- Улучшена обработка истории изменений заказов
|
- Добавлена возможность указать свойство в настройках экспорта, из которого будет подставляться картинка, если отсутствует в "Подробно" и "Анонс"
|
||||||
|
- Добавлена подстановка домена в ссылках каталога в зависимости от пренадлежности инфоблока к сайту
|
@ -113,6 +113,22 @@ if (file_exists($_SERVER["DOCUMENT_ROOT"]."/bitrix/php_interface/retailcrm/expor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$productPictures = array();
|
||||||
|
|
||||||
|
if (is_array($IBLOCK_PROPERTY_PRODUCT_picture)) {
|
||||||
|
foreach ($IBLOCK_PROPERTY_PRODUCT_picture as $key => $value) {
|
||||||
|
$productPictures[$key]['picture'] = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$skuPictures = array();
|
||||||
|
|
||||||
|
if (is_array($IBLOCK_PROPERTY_SKU_picture)) {
|
||||||
|
foreach ($IBLOCK_PROPERTY_SKU_picture as $key => $value) {
|
||||||
|
$skuPictures[$key]['picture'] = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$loader = new RetailCrmICML();
|
$loader = new RetailCrmICML();
|
||||||
$loader->profileID = $PROFILE_ID;
|
$loader->profileID = $PROFILE_ID;
|
||||||
$loader->iblocks = $IBLOCK_EXPORT;
|
$loader->iblocks = $IBLOCK_EXPORT;
|
||||||
@ -120,6 +136,8 @@ if (file_exists($_SERVER["DOCUMENT_ROOT"]."/bitrix/php_interface/retailcrm/expor
|
|||||||
$loader->propertiesUnitSKU = $IBLOCK_PROPERTY_UNIT_SKU;
|
$loader->propertiesUnitSKU = $IBLOCK_PROPERTY_UNIT_SKU;
|
||||||
$loader->propertiesProduct = $IBLOCK_PROPERTY_PRODUCT;
|
$loader->propertiesProduct = $IBLOCK_PROPERTY_PRODUCT;
|
||||||
$loader->propertiesUnitProduct = $IBLOCK_PROPERTY_UNIT_PRODUCT;
|
$loader->propertiesUnitProduct = $IBLOCK_PROPERTY_UNIT_PRODUCT;
|
||||||
|
$loader->productPictures = $productPictures;
|
||||||
|
$loader->skuPictures = $skuPictures;
|
||||||
|
|
||||||
if ($hlblockModule === true) {
|
if ($hlblockModule === true) {
|
||||||
$loader->highloadblockSkuProperties = $IBLOCK_PROPERTY_SKU_HIGHLOADBLOCK;
|
$loader->highloadblockSkuProperties = $IBLOCK_PROPERTY_SKU_HIGHLOADBLOCK;
|
||||||
@ -127,7 +145,7 @@ if (file_exists($_SERVER["DOCUMENT_ROOT"]."/bitrix/php_interface/retailcrm/expor
|
|||||||
}
|
}
|
||||||
|
|
||||||
$loader->filename = $SETUP_FILE_NAME;
|
$loader->filename = $SETUP_FILE_NAME;
|
||||||
$loader->serverName = $SERVER_NAME;
|
$loader->defaultServerName = $SERVER_NAME;
|
||||||
$loader->application = $APPLICATION;
|
$loader->application = $APPLICATION;
|
||||||
$loader->loadPurchasePrice = $LOAD_PURCHASE_PRICE == 'Y';
|
$loader->loadPurchasePrice = $LOAD_PURCHASE_PRICE == 'Y';
|
||||||
$loader->Load();
|
$loader->Load();
|
||||||
|
@ -29,6 +29,7 @@ if (file_exists($_SERVER["DOCUMENT_ROOT"]."/bitrix/php_interface/retailcrm/expor
|
|||||||
"length" => "length",
|
"length" => "length",
|
||||||
"width" => "width",
|
"width" => "width",
|
||||||
"height" => "height",
|
"height" => "height",
|
||||||
|
"picture" => "picture"
|
||||||
);
|
);
|
||||||
|
|
||||||
if(!check_bitrix_sessid()) {
|
if(!check_bitrix_sessid()) {
|
||||||
@ -164,10 +165,10 @@ if (file_exists($_SERVER["DOCUMENT_ROOT"]."/bitrix/php_interface/retailcrm/expor
|
|||||||
"length" => GetMessage("PROPERTY_LENGTH_HEADER_NAME"),
|
"length" => GetMessage("PROPERTY_LENGTH_HEADER_NAME"),
|
||||||
"width" => GetMessage("PROPERTY_WIDTH_HEADER_NAME"),
|
"width" => GetMessage("PROPERTY_WIDTH_HEADER_NAME"),
|
||||||
"height" => GetMessage("PROPERTY_HEIGHT_HEADER_NAME"),
|
"height" => GetMessage("PROPERTY_HEIGHT_HEADER_NAME"),
|
||||||
|
"picture" => GetMessage("PROPERTY_PICTURE_HEADER_NAME")
|
||||||
);
|
);
|
||||||
|
|
||||||
$iblockFieldsName = Array(
|
$iblockFieldsName = Array(
|
||||||
|
|
||||||
"weight" => Array("code" => "catalog_weight" , "name" => GetMessage("SELECT_WEIGHT_PROPERTY_NAME"), 'unit' => 'mass'),
|
"weight" => Array("code" => "catalog_weight" , "name" => GetMessage("SELECT_WEIGHT_PROPERTY_NAME"), 'unit' => 'mass'),
|
||||||
"length" => Array("code" => "catalog_length" , "name" => GetMessage("SELECT_LENGTH_PROPERTY_NAME"), 'unit' => 'length'),
|
"length" => Array("code" => "catalog_length" , "name" => GetMessage("SELECT_LENGTH_PROPERTY_NAME"), 'unit' => 'length'),
|
||||||
"width" => Array("code" => "catalog_width" , "name" => GetMessage("SELECT_WIDTH_PROPERTY_NAME"), 'unit' => 'length'),
|
"width" => Array("code" => "catalog_width" , "name" => GetMessage("SELECT_WIDTH_PROPERTY_NAME"), 'unit' => 'length'),
|
||||||
@ -183,6 +184,7 @@ if (file_exists($_SERVER["DOCUMENT_ROOT"]."/bitrix/php_interface/retailcrm/expor
|
|||||||
"length" => Array("LENGTH", "DLINA"),
|
"length" => Array("LENGTH", "DLINA"),
|
||||||
"width" => Array("WIDTH", "SHIRINA"),
|
"width" => Array("WIDTH", "SHIRINA"),
|
||||||
"height" => Array("HEIGHT", "VISOTA"),
|
"height" => Array("HEIGHT", "VISOTA"),
|
||||||
|
"picture" => Array("PICTURE", "PICTURE")
|
||||||
);
|
);
|
||||||
|
|
||||||
$units = Array(
|
$units = Array(
|
||||||
@ -795,7 +797,7 @@ if (file_exists($_SERVER["DOCUMENT_ROOT"]."/bitrix/php_interface/retailcrm/expor
|
|||||||
$vals .= ",IBLOCK_PROPERTY_PRODUCT_" . $val;
|
$vals .= ",IBLOCK_PROPERTY_PRODUCT_" . $val;
|
||||||
$vals .= ",IBLOCK_PROPERTY_UNIT_PRODUCT_" . $val;
|
$vals .= ",IBLOCK_PROPERTY_UNIT_PRODUCT_" . $val;
|
||||||
|
|
||||||
if ($hlblockModule === true) {
|
if ($hlblockModule === true && $val != 'picture') {
|
||||||
foreach ($hlblockList as $hlblockTable => $hlblock) {
|
foreach ($hlblockList as $hlblockTable => $hlblock) {
|
||||||
$vals .= ',highloadblock' . $hlblockTable . '_' . $val;
|
$vals .= ',highloadblock' . $hlblockTable . '_' . $val;
|
||||||
}
|
}
|
||||||
|
@ -796,11 +796,13 @@ class intaro_retailcrm extends CModule
|
|||||||
"length" => "length",
|
"length" => "length",
|
||||||
"width" => "width",
|
"width" => "width",
|
||||||
"height" => "height",
|
"height" => "height",
|
||||||
|
"picture" => "picture",
|
||||||
);
|
);
|
||||||
|
|
||||||
$propertiesSKU = array();
|
$propertiesSKU = array();
|
||||||
$propertiesUnitSKU = array();
|
$propertiesUnitSKU = array();
|
||||||
$propertiesHbSKU = array();
|
$propertiesHbSKU = array();
|
||||||
|
|
||||||
foreach ($iblockProperties as $prop) {
|
foreach ($iblockProperties as $prop) {
|
||||||
foreach ($_POST['IBLOCK_PROPERTY_SKU'. '_' . $prop] as $iblock => $val) {
|
foreach ($_POST['IBLOCK_PROPERTY_SKU'. '_' . $prop] as $iblock => $val) {
|
||||||
$propertiesSKU[$iblock][$prop] = $val;
|
$propertiesSKU[$iblock][$prop] = $val;
|
||||||
@ -809,7 +811,7 @@ class intaro_retailcrm extends CModule
|
|||||||
$propertiesUnitSKU[$iblock][$prop] = $val;
|
$propertiesUnitSKU[$iblock][$prop] = $val;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($hlblockModule === true) {
|
if ($hlblockModule === true && $prop != 'picture') {
|
||||||
foreach ($hlblockList as $tableName => $hb) {
|
foreach ($hlblockList as $tableName => $hb) {
|
||||||
foreach ($_POST['highloadblock' . $tableName . '_' . $prop] as $iblock => $val) {
|
foreach ($_POST['highloadblock' . $tableName . '_' . $prop] as $iblock => $val) {
|
||||||
$propertiesHbSKU[$tableName][$iblock][$prop] = $val;
|
$propertiesHbSKU[$tableName][$iblock][$prop] = $val;
|
||||||
@ -821,6 +823,7 @@ class intaro_retailcrm extends CModule
|
|||||||
$propertiesProduct = array();
|
$propertiesProduct = array();
|
||||||
$propertiesUnitProduct = array();
|
$propertiesUnitProduct = array();
|
||||||
$propertiesHbProduct = array();
|
$propertiesHbProduct = array();
|
||||||
|
|
||||||
foreach ($iblockProperties as $prop) {
|
foreach ($iblockProperties as $prop) {
|
||||||
foreach ($_POST['IBLOCK_PROPERTY_PRODUCT'. '_' . $prop] as $iblock => $val) {
|
foreach ($_POST['IBLOCK_PROPERTY_PRODUCT'. '_' . $prop] as $iblock => $val) {
|
||||||
$propertiesProduct[$iblock][$prop] = $val;
|
$propertiesProduct[$iblock][$prop] = $val;
|
||||||
@ -829,7 +832,7 @@ class intaro_retailcrm extends CModule
|
|||||||
$propertiesUnitProduct[$iblock][$prop] = $val;
|
$propertiesUnitProduct[$iblock][$prop] = $val;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($hlblockModule === true) {
|
if ($hlblockModule === true && $prop != 'picture') {
|
||||||
foreach ($hlblockList as $tableName => $hb) {
|
foreach ($hlblockList as $tableName => $hb) {
|
||||||
foreach ($_POST['highloadblock_product' . $tableName . '_' . $prop] as $iblock => $val) {
|
foreach ($_POST['highloadblock_product' . $tableName . '_' . $prop] as $iblock => $val) {
|
||||||
$propertiesHbProduct[$tableName][$iblock][$prop] = $val;
|
$propertiesHbProduct[$tableName][$iblock][$prop] = $val;
|
||||||
|
@ -20,7 +20,6 @@ if (!empty($oldValues)) {
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
.iblock-export-table-display-none {
|
.iblock-export-table-display-none {
|
||||||
display: none;
|
display: none;
|
||||||
@ -45,10 +44,10 @@ if (!empty($oldValues)) {
|
|||||||
"length" => GetMessage("PROPERTY_LENGTH_HEADER_NAME"),
|
"length" => GetMessage("PROPERTY_LENGTH_HEADER_NAME"),
|
||||||
"width" => GetMessage("PROPERTY_WIDTH_HEADER_NAME"),
|
"width" => GetMessage("PROPERTY_WIDTH_HEADER_NAME"),
|
||||||
"height" => GetMessage("PROPERTY_HEIGHT_HEADER_NAME"),
|
"height" => GetMessage("PROPERTY_HEIGHT_HEADER_NAME"),
|
||||||
|
"picture" => GetMessage("PROPERTY_PICTURE_HEADER_NAME"),
|
||||||
);
|
);
|
||||||
|
|
||||||
$iblockFieldsName = Array(
|
$iblockFieldsName = Array(
|
||||||
|
|
||||||
"weight" => Array("code" => "catalog_size" , "name" => GetMessage("SELECT_WEIGHT_PROPERTY_NAME"), 'unit' => 'mass'),
|
"weight" => Array("code" => "catalog_size" , "name" => GetMessage("SELECT_WEIGHT_PROPERTY_NAME"), 'unit' => 'mass'),
|
||||||
"length" => Array("code" => "catalog_length" , "name" => GetMessage("SELECT_LENGTH_PROPERTY_NAME"), 'unit' => 'length'),
|
"length" => Array("code" => "catalog_length" , "name" => GetMessage("SELECT_LENGTH_PROPERTY_NAME"), 'unit' => 'length'),
|
||||||
"width" => Array("code" => "catalog_width" , "name" => GetMessage("SELECT_WIDTH_PROPERTY_NAME"), 'unit' => 'length'),
|
"width" => Array("code" => "catalog_width" , "name" => GetMessage("SELECT_WIDTH_PROPERTY_NAME"), 'unit' => 'length'),
|
||||||
@ -64,6 +63,7 @@ if (!empty($oldValues)) {
|
|||||||
"length" => Array("LENGTH", "DLINA"),
|
"length" => Array("LENGTH", "DLINA"),
|
||||||
"width" => Array("WIDTH", "SHIRINA"),
|
"width" => Array("WIDTH", "SHIRINA"),
|
||||||
"height" => Array("HEIGHT", "VISOTA"),
|
"height" => Array("HEIGHT", "VISOTA"),
|
||||||
|
"picture" => Array("PICTURE", "PICTURE"),
|
||||||
);
|
);
|
||||||
|
|
||||||
$units = Array(
|
$units = Array(
|
||||||
@ -84,8 +84,6 @@ if (!empty($oldValues)) {
|
|||||||
'mass' => 'g'
|
'mass' => 'g'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$boolAll = false;
|
$boolAll = false;
|
||||||
$intCountChecked = 0;
|
$intCountChecked = 0;
|
||||||
$intCountAvailIBlock = 0;
|
$intCountAvailIBlock = 0;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?
|
<?
|
||||||
$arModuleVersion = array(
|
$arModuleVersion = array(
|
||||||
"VERSION" => "2.3.10",
|
"VERSION" => "2.3.11",
|
||||||
"VERSION_DATE" => "2018-09-26 13:30:00"
|
"VERSION_DATE" => "2018-10-04 16:15:00"
|
||||||
);
|
);
|
||||||
|
@ -28,6 +28,7 @@ $MESS["PROPERTY_WEIGHT_HEADER_NAME"] = "Вес (габариты)";
|
|||||||
$MESS["PROPERTY_LENGTH_HEADER_NAME"] = "Длина (габариты)";
|
$MESS["PROPERTY_LENGTH_HEADER_NAME"] = "Длина (габариты)";
|
||||||
$MESS["PROPERTY_WIDTH_HEADER_NAME"] = "Ширина (габариты)";
|
$MESS["PROPERTY_WIDTH_HEADER_NAME"] = "Ширина (габариты)";
|
||||||
$MESS["PROPERTY_HEIGHT_HEADER_NAME"] = "Высота (габариты)";
|
$MESS["PROPERTY_HEIGHT_HEADER_NAME"] = "Высота (габариты)";
|
||||||
|
$MESS["PROPERTY_PICTURE_HEADER_NAME"] = "Фото";
|
||||||
$MESS["PROPERTY_SIZE_HEADER_NAME"] = "Размер";
|
$MESS["PROPERTY_SIZE_HEADER_NAME"] = "Размер";
|
||||||
$MESS["SELECT_FIELD_NAME"] = "Поле";
|
$MESS["SELECT_FIELD_NAME"] = "Поле";
|
||||||
$MESS["SELECT_PROPERTY_NAME"] = "Свойства";
|
$MESS["SELECT_PROPERTY_NAME"] = "Свойства";
|
||||||
|
@ -268,7 +268,6 @@ if (isset($_POST['Update']) && ($_POST['Update'] == 'Y')) {
|
|||||||
$paymentArr['Y'] = htmlspecialchars(trim($_POST['payment-Y']));
|
$paymentArr['Y'] = htmlspecialchars(trim($_POST['payment-Y']));
|
||||||
$paymentArr['N'] = htmlspecialchars(trim($_POST['payment-N']));
|
$paymentArr['N'] = htmlspecialchars(trim($_POST['payment-N']));
|
||||||
|
|
||||||
|
|
||||||
$previousDischarge = COption::GetOptionString($mid, $CRM_ORDER_DISCHARGE, 0);
|
$previousDischarge = COption::GetOptionString($mid, $CRM_ORDER_DISCHARGE, 0);
|
||||||
//order discharge mode
|
//order discharge mode
|
||||||
// 0 - agent
|
// 0 - agent
|
||||||
@ -280,16 +279,11 @@ if (isset($_POST['Update']) && ($_POST['Update'] == 'Y')) {
|
|||||||
UnRegisterModuleDependences("sale", "OnSaleOrderEntitySaved", $mid, "RetailCrmEvent", "orderSave");
|
UnRegisterModuleDependences("sale", "OnSaleOrderEntitySaved", $mid, "RetailCrmEvent", "orderSave");
|
||||||
UnRegisterModuleDependences("sale", "OnOrderUpdate", $mid, "RetailCrmEvent", "onUpdateOrder");
|
UnRegisterModuleDependences("sale", "OnOrderUpdate", $mid, "RetailCrmEvent", "onUpdateOrder");
|
||||||
UnRegisterModuleDependences("sale", "OnSaleOrderDeleted", $mid, "RetailCrmEvent", "orderDelete");
|
UnRegisterModuleDependences("sale", "OnSaleOrderDeleted", $mid, "RetailCrmEvent", "orderDelete");
|
||||||
UnRegisterModuleDependences("sale", "OnSalePaymentEntitySaved", $mid, "RetailCrmEvent", "paymentSave");
|
|
||||||
UnRegisterModuleDependences("sale", "OnSalePaymentEntityDeleted", $mid, "RetailCrmEvent", "paymentDelete");
|
|
||||||
|
|
||||||
} elseif (($orderDischarge != $previousDischarge) && ($orderDischarge == 1)) {
|
} elseif (($orderDischarge != $previousDischarge) && ($orderDischarge == 1)) {
|
||||||
// event dependencies
|
// event dependencies
|
||||||
RegisterModuleDependences("sale", "OnSaleOrderEntitySaved", $mid, "RetailCrmEvent", "orderSave");
|
RegisterModuleDependences("sale", "OnSaleOrderEntitySaved", $mid, "RetailCrmEvent", "orderSave");
|
||||||
RegisterModuleDependences("sale", "OnOrderUpdate", $mid, "RetailCrmEvent", "onUpdateOrder");
|
RegisterModuleDependences("sale", "OnOrderUpdate", $mid, "RetailCrmEvent", "onUpdateOrder");
|
||||||
RegisterModuleDependences("sale", "OnSaleOrderDeleted", $mid, "RetailCrmEvent", "orderDelete");
|
RegisterModuleDependences("sale", "OnSaleOrderDeleted", $mid, "RetailCrmEvent", "orderDelete");
|
||||||
RegisterModuleDependences("sale", "OnSalePaymentEntitySaved", $mid, "RetailCrmEvent", "paymentSave");
|
|
||||||
RegisterModuleDependences("sale", "OnSalePaymentEntityDeleted", $mid, "RetailCrmEvent", "paymentDelete");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$orderPropsArr = array();
|
$orderPropsArr = array();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user