1
0
mirror of synced 2024-11-25 06:46:08 +03:00
This commit is contained in:
Akolzin Dmitry 2018-06-13 13:05:58 +03:00
parent 83d3ec1dc1
commit 0ebb1be7d1
7 changed files with 61 additions and 19 deletions

View File

@ -1,3 +1,9 @@
## 2018-06-33 v.2.3.7
* Добавлена выгрузка штрихкодов в ICML
* Добавлена выгрузка картинок торговых предложений в ICML
* Улучшена передача типа доставки в заказе
* Добавлена проверка некоторых настроек при передаче заказа
## 2018-05-23 v.2.3.6
* Улучшена выгрузка свойств товаров типа "справочник"
* Добавлена настройка выгрузки габаритов и веса в заказе

View File

@ -293,7 +293,10 @@ class RetailCrmHistory
if (is_array($newResOrder) && !empty($newResOrder)) {
$order = $newResOrder;
} elseif ($newResOrder === false) {
RCrmActions::eventLog('RetailCrmHistory::orderHistory', 'retailCrmBeforeOrderSave()', 'OrderCrmId = ' . $order['id'] . '. Sending canceled after retailCrmBeforeOrderSave');
RCrmActions::eventLog('RetailCrmHistory::orderHistory',
'retailCrmBeforeOrderSave()',
'OrderCrmId = ' . $order['id'] . '. Sending canceled after retailCrmBeforeOrderSave'
);
continue;
}

View File

@ -253,6 +253,21 @@ class RetailCrmICML
);
foreach ($this->iblocks as $key => $id) {
$barcodes = array();
$dbBarCode = CCatalogStoreBarCode::getList(
array(),
array("IBLOCK_ID" => $id),
false,
false,
array('PRODUCT_ID', 'BARCODE')
);
while($arBarCode = $dbBarCode->GetNext()) {
if (!empty($arBarCode)) {
$barcodes[$arBarCode['PRODUCT_ID']] = $arBarCode['BARCODE'];
}
}
$highloadblockSkuProps = array();
$highloadblockProductProps = array();
@ -389,6 +404,7 @@ class RetailCrmICML
while ($offer = $dbResOffers->GetNext()) {
// Link offers to products
$offer['PICTURE'] = $this->protocol . $this->serverName . CFile::GetPath($offer["DETAIL_PICTURE"]);
$products[$offer['PROPERTY_' . $iblockOffer['SKU_PROPERTY_ID'] . '_VALUE']]['offers'][$offer['ID']] = $offer;
}
unset($offer, $dbResOffers);
@ -437,13 +453,13 @@ class RetailCrmICML
$categories[$catId] = $allCategories[$catId];
}
$existOffer = false;
if (!empty($iblockOffer['IBLOCK_ID'])) {
foreach ($product['offers'] as $offer) {
$offer['BARCODE'] = isset($barcodes[$offer['ID']]) ? $barcodes[$offer['ID']] : '';
$offer['PRODUCT_ID'] = $product["ID"];
$offer['DETAIL_PAGE_URL'] = $product["DETAIL_PAGE_URL"];
$offer['PICTURE'] = $product["PICTURE"];
$offer['PICTURE'] = $offer["PICTURE"] ? $offer["PICTURE"] : $product["PICTURE"];
$offer['PRODUCT_NAME'] = $product["NAME"];
$offer['PRODUCT_ACTIVE'] = $product["ACTIVE"];
$offer['PRICE'] = $offer['CATALOG_PRICE_' . $basePriceId];
@ -484,6 +500,7 @@ class RetailCrmICML
}
}
if (!$existOffer) {
$offer['BARCODE'] = isset($barcodes[$product["ID"]]) ? $barcodes[$product["ID"]] : '';
$product['PRODUCT_ID'] = $product["ID"];
$product['PRODUCT_NAME'] = $product["NAME"];
$product['PRODUCT_ACTIVE'] = $product["ACTIVE"];
@ -499,7 +516,6 @@ class RetailCrmICML
$stringOffers .= $this->BuildOffer($product, $categories, $iblock, $allCategories);
}
}
unset($products);
@ -589,6 +605,9 @@ class RetailCrmICML
}
}
if ($arOffer["BARCODE"]) {
$offer.= "<barcode>" . $this->PrepareValue($arOffer["BARCODE"]) . "</barcode>\n";
}
$offer.= "</offer>\n";

View File

@ -70,9 +70,13 @@ class RetailCrmOrder
//fields
foreach ($arFields['PROPS']['properties'] as $prop) {
if ($search = array_search($prop['CODE'], $arParams['optionsLegalDetails'][$arFields['PERSON_TYPE_ID']])) {
if (!empty($arParams['optionsLegalDetails'])
&& $search = array_search($prop['CODE'], $arParams['optionsLegalDetails'][$arFields['PERSON_TYPE_ID']])
) {
$order['contragent'][$search] = $prop['VALUE'][0];//legal order data
} elseif ($search = array_search($prop['CODE'], $arParams['optionsCustomFields'][$arFields['PERSON_TYPE_ID']])) {
} elseif (!empty($arParams['optionsCustomFields'])
&& $search = array_search($prop['CODE'], $arParams['optionsCustomFields'][$arFields['PERSON_TYPE_ID']])
) {
$order['customFields'][$search] = $prop['VALUE'][0];//custom properties
} elseif ($search = array_search($prop['CODE'], $arParams['optionsOrderProps'][$arFields['PERSON_TYPE_ID']])) {//other
if (in_array($search, array('fio', 'phone', 'email'))) {//fio, phone, email
@ -340,6 +344,10 @@ class RetailCrmOrder
$shipmentList = $obOrder->getShipmentCollection();
foreach ($shipmentList as $shipmentData) {
if ($shipmentData->isSystem()) {
continue;
}
if ($shipmentData->getDeliveryId()) {
$delivery = \Bitrix\Sale\Delivery\Services\Manager::getById($shipmentData->getDeliveryId());
$siteDeliverys = RCrmActions::DeliveryList();

View File

@ -74,9 +74,13 @@ class RetailCrmOrder
//fields
foreach ($arFields['PROPS']['properties'] as $prop) {
if ($search = array_search($prop['CODE'], $arParams['optionsLegalDetails'][$arFields['PERSON_TYPE_ID']])) {
if (!empty($arParams['optionsLegalDetails'])
&& $search = array_search($prop['CODE'], $arParams['optionsLegalDetails'][$arFields['PERSON_TYPE_ID']])
) {
$order['contragent'][$search] = $prop['VALUE'][0];//legal order data
} elseif ($search = array_search($prop['CODE'], $arParams['optionsCustomFields'][$arFields['PERSON_TYPE_ID']])) {
} elseif (!empty($arParams['optionsCustomFields'])
&& $search = array_search($prop['CODE'], $arParams['optionsCustomFields'][$arFields['PERSON_TYPE_ID']])
) {
$order['customFields'][$search] = $prop['VALUE'][0];//custom properties
} elseif ($search = array_search($prop['CODE'], $arParams['optionsOrderProps'][$arFields['PERSON_TYPE_ID']])) {//other
if (in_array($search, array('fio', 'phone', 'email'))) {//fio, phone, email
@ -389,6 +393,10 @@ class RetailCrmOrder
$shipmentList = $obOrder->getShipmentCollection();
foreach ($shipmentList as $shipmentData) {
if ($shipmentData->isSystem()) {
continue;
}
if ($shipmentData->getDeliveryId()) {
$delivery = \Bitrix\Sale\Delivery\Services\Manager::getById($shipmentData->getDeliveryId());
$siteDeliverys = RCrmActions::DeliveryList();

View File

@ -1,6 +1,4 @@
- Улучшена выгрузка свойств товаров типа "справочник"
- Добавлена настройка выгрузки габаритов и веса в заказе
- Добавлена совместимость натройки экспорта для Google Chrome
- Исправлена ошибка при выгрузке истории с пустым городом
- Добавлены проверки на существование модуля Highloadblock
- Исправлен баг с отправкой пустого заказа при удалении в 1С-Битрикс
- Добавлена выгрузка штрихкодов в ICML
- Добавлена выгрузка картинок торговых предложений в ICML
- Улучшена передача типа доставки в заказе
- Добавлена проверка некоторых настроек при передаче заказа

View File

@ -1,5 +1,5 @@
<?
$arModuleVersion = array(
"VERSION" => "2.3.6",
"VERSION_DATE" => "2018-05-23 13:15:00"
"VERSION" => "2.3.7",
"VERSION_DATE" => "2018-06-13 13:15:00"
);