Skip to content

Commit

Permalink
Передача профилей модуля Почты России (#370)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellynoize authored Oct 28, 2024
1 parent 317a30b commit d25c7fc
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 2024-10-24 v6.5.36
- Добавлена передача профилей доставки Официального модуля Почты России

## 2024-10-22 v6.5.35
- Исправлена подписка модуля на событие сохранения заказа

Expand Down
4 changes: 3 additions & 1 deletion intaro.retailcrm/classes/general/order/RetailCrmOrder_v5.php
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,9 @@ public static function orderObjToArr(Order $obOrder): array
}
if ($delivery['PARENT_ID']) {
$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 {
$shipment = ['id' => $delivery['ID']];
}
Expand Down
2 changes: 1 addition & 1 deletion intaro.retailcrm/description.ru
Original file line number Diff line number Diff line change
@@ -1 +1 @@
- Исправлена подписка модуля на событие сохранения заказа
- Добавлена передача профилей доставки Официального модуля Почты России
4 changes: 2 additions & 2 deletions intaro.retailcrm/install/version.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

$arModuleVersion = [
'VERSION' => '6.5.35',
'VERSION_DATE' => '2024-10-22 17:00:00'
'VERSION' => '6.5.36',
'VERSION_DATE' => '2024-10-24 15:00:00'
];
2 changes: 1 addition & 1 deletion intaro.retailcrm/lib/component/constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
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 BITRIX_USER_ID_PREFIX = 'bitrixUserId-';
public const CRM_USERS_MAP = 'crm_users_map';
Expand Down
4 changes: 2 additions & 2 deletions intaro.retailcrm/options.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
}

//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_key = COption::GetOptionString($mid, Constants::CRM_API_KEY_OPTION , 0);
$api = new RetailCrm\ApiClient($api_host, $api_key);
Expand All @@ -108,7 +108,7 @@

foreach ($optionsDelivTypes as $key => $deliveryType) {
foreach ($arDeliveryServiceAll as $deliveryService) {
if ($deliveryService['PARENT_ID'] != 0 && $deliveryService['PARENT_ID'] === $key) {
if ($deliveryService['PARENT_ID'] != 0 && $deliveryService['PARENT_ID'] == $key) {
try {
$api->deliveryServicesEdit(RCrmActions::clearArr([
'code' => 'bitrix-' . $deliveryService['ID'],
Expand Down

0 comments on commit d25c7fc

Please sign in to comment.