Merge pull request #120 from iyzoer/master

v3.1.5
This commit is contained in:
Alex Lushpai 2018-11-02 20:18:39 +03:00 committed by GitHub
commit 3e55de0e3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 4 deletions

View File

@ -1,3 +1,6 @@
## v.3.1.5
* Исправление ошибок
## v.3.1.4 ## v.3.1.4
* Исправлена некорректная склейка типов доставки * Исправлена некорректная склейка типов доставки

View File

@ -1 +1 @@
3.1.4 3.1.5

View File

@ -15,9 +15,11 @@ class ControllerApiRetailcrm extends Controller
$moduleTitle = $this->retailcrm->getModuleTitle(); $moduleTitle = $this->retailcrm->getModuleTitle();
$setting = $this->model_setting_setting->getSetting($moduleTitle); $setting = $this->model_setting_setting->getSetting($moduleTitle);
$response = array();
if (isset($setting[$moduleTitle . '_country']) && $setting[$moduleTitle . '_country']) { if (isset($setting[$moduleTitle . '_country']) && $setting[$moduleTitle . '_country']) {
foreach ($setting[$moduleTitle . '_country'] as $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; return $deliveryTypes;
} }
private function mergeDeliveryTypes($country) { private function mergeDeliveryTypes($country, $result) {
$result = array();
$delivery_types = $this->getDeliveryTypesByZones($country); $delivery_types = $this->getDeliveryTypesByZones($country);
foreach ($delivery_types as $shipping_module => $shipping_type) { foreach ($delivery_types as $shipping_module => $shipping_type) {