From bceb2069aca6d6eb172b00722e1a141e91190b84 Mon Sep 17 00:00:00 2001 From: Akolzin Dmitry Date: Fri, 2 Nov 2018 09:29:46 +0300 Subject: [PATCH] Bug fix --- CHANGELOG.md | 3 +++ VERSION | 2 +- src/upload/catalog/controller/api/retailcrm.php | 7 ++++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 95eea3e..bd9c77a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## v.3.1.5 +* Исправление ошибок + ## v.3.1.4 * Исправлена некорректная склейка типов доставки diff --git a/VERSION b/VERSION index 0aec50e..3ad0595 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.1.4 +3.1.5 diff --git a/src/upload/catalog/controller/api/retailcrm.php b/src/upload/catalog/controller/api/retailcrm.php index cf2716c..4dfa9a2 100644 --- a/src/upload/catalog/controller/api/retailcrm.php +++ b/src/upload/catalog/controller/api/retailcrm.php @@ -15,9 +15,11 @@ class ControllerApiRetailcrm extends Controller $moduleTitle = $this->retailcrm->getModuleTitle(); $setting = $this->model_setting_setting->getSetting($moduleTitle); + $response = array(); + if (isset($setting[$moduleTitle . '_country']) && $setting[$moduleTitle . '_country']) { foreach ($setting[$moduleTitle . '_country'] as $country) { - $response = $this->mergeDeliveryTypes($country); + $response = $this->mergeDeliveryTypes($country, $response); } } } @@ -130,8 +132,7 @@ class ControllerApiRetailcrm extends Controller return $deliveryTypes; } - private function mergeDeliveryTypes($country) { - $result = array(); + private function mergeDeliveryTypes($country, $result) { $delivery_types = $this->getDeliveryTypesByZones($country); foreach ($delivery_types as $shipping_module => $shipping_type) {