1
0
mirror of synced 2024-11-23 22:06:11 +03:00

Передача профилей модуля Почты России (#370)

This commit is contained in:
ellynoize 2024-10-28 11:21:46 +03:00 committed by GitHub
parent 317a30b682
commit d25c7fc484
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 12 additions and 7 deletions

View File

@ -1,3 +1,6 @@
## 2024-10-24 v6.5.36
- Добавлена передача профилей доставки Официального модуля Почты России
## 2024-10-22 v6.5.35 ## 2024-10-22 v6.5.35
- Исправлена подписка модуля на событие сохранения заказа - Исправлена подписка модуля на событие сохранения заказа

View File

@ -995,7 +995,9 @@ class RetailCrmOrder
} }
if ($delivery['PARENT_ID']) { if ($delivery['PARENT_ID']) {
$service = explode(':', $delivery['CODE']); $service = explode(':', $delivery['CODE']);
$shipment = ['id' => $delivery['PARENT_ID'], 'service' => $service[1]]; $shipment = $delivery['CLASS_NAME'] === '\Sale\Handlers\Delivery\RussianpostProfile'
? ['id' => $delivery['PARENT_ID'], 'service' => 'bitrix-' . $delivery['ID']]
: ['id' => $delivery['PARENT_ID'], 'service' => $service[1]];
} else { } else {
$shipment = ['id' => $delivery['ID']]; $shipment = ['id' => $delivery['ID']];
} }

View File

@ -1 +1 @@
- Исправлена подписка модуля на событие сохранения заказа - Добавлена передача профилей доставки Официального модуля Почты России

View File

@ -1,6 +1,6 @@
<?php <?php
$arModuleVersion = [ $arModuleVersion = [
'VERSION' => '6.5.35', 'VERSION' => '6.5.36',
'VERSION_DATE' => '2024-10-22 17:00:00' 'VERSION_DATE' => '2024-10-24 15:00:00'
]; ];

View File

@ -18,7 +18,7 @@ namespace Intaro\RetailCrm\Component;
*/ */
class Constants class Constants
{ {
public const MODULE_VERSION = '6.5.35'; public const MODULE_VERSION = '6.5.36';
public const CRM_PURCHASE_PRICE_NULL = 'purchasePrice_null'; public const CRM_PURCHASE_PRICE_NULL = 'purchasePrice_null';
public const BITRIX_USER_ID_PREFIX = 'bitrixUserId-'; public const BITRIX_USER_ID_PREFIX = 'bitrixUserId-';
public const CRM_USERS_MAP = 'crm_users_map'; public const CRM_USERS_MAP = 'crm_users_map';

View File

@ -85,7 +85,7 @@ if (method_exists(RCrmActions::class, 'customOrderPropList')
} }
//ajax update deliveryServices //ajax update deliveryServices
if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && (strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest') && isset($_POST['ajax']) && ($_POST['ajax'] === 1)) { if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && (strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest') && isset($_POST['ajax']) && ($_POST['ajax'] === '1')) {
$api_host = COption::GetOptionString($mid, Constants::CRM_API_HOST_OPTION, 0); $api_host = COption::GetOptionString($mid, Constants::CRM_API_HOST_OPTION, 0);
$api_key = COption::GetOptionString($mid, Constants::CRM_API_KEY_OPTION , 0); $api_key = COption::GetOptionString($mid, Constants::CRM_API_KEY_OPTION , 0);
$api = new RetailCrm\ApiClient($api_host, $api_key); $api = new RetailCrm\ApiClient($api_host, $api_key);
@ -108,7 +108,7 @@ if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && (strtolower($_SERVER['HTTP_X_RE
foreach ($optionsDelivTypes as $key => $deliveryType) { foreach ($optionsDelivTypes as $key => $deliveryType) {
foreach ($arDeliveryServiceAll as $deliveryService) { foreach ($arDeliveryServiceAll as $deliveryService) {
if ($deliveryService['PARENT_ID'] != 0 && $deliveryService['PARENT_ID'] === $key) { if ($deliveryService['PARENT_ID'] != 0 && $deliveryService['PARENT_ID'] == $key) {
try { try {
$api->deliveryServicesEdit(RCrmActions::clearArr([ $api->deliveryServicesEdit(RCrmActions::clearArr([
'code' => 'bitrix-' . $deliveryService['ID'], 'code' => 'bitrix-' . $deliveryService['ID'],