This commit is contained in:
Akolzin Dmitry 2018-11-01 15:18:59 +03:00
parent bca86cc51c
commit 9fb324188b
4 changed files with 39 additions and 7 deletions

15
.env-dist Normal file
View File

@ -0,0 +1,15 @@
# OpenCart Database connection values
OC_DB_HOSTNAME=host
OC_DB_USERNAME=user
OC_DB_PASSWORD=pass
OC_DB_DATABASE=database
OC_DB_DRIVER=mysqli
# OpenCart Administration user
OC_USERNAME=admin
OC_PASSWORD=admin
OC_EMAIL=you@example.com
# Server Specification
SERVER_PORT=8000
SERVER_URL=http://localhost

View File

@ -1,3 +1,6 @@
## v.3.1.4
* Исправлена некорректная склейка типов доставки
## v.3.1.3
* Добавлена активация модуля в маркетплейсе retailCRM

View File

@ -1 +1 @@
3.1.3
3.1.4

View File

@ -14,11 +14,10 @@ class ControllerApiRetailcrm extends Controller
$this->load->library('retailcrm/retailcrm');
$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 = array_merge($response, $this->getDeliveryTypesByZones($country));
$response = $this->mergeDeliveryTypes($country);
}
}
}
@ -131,6 +130,21 @@ class ControllerApiRetailcrm extends Controller
return $deliveryTypes;
}
private function mergeDeliveryTypes($country) {
$result = array();
$delivery_types = $this->getDeliveryTypesByZones($country);
foreach ($delivery_types as $shipping_module => $shipping_type) {
if (isset($result[$shipping_module])) {
$result[$shipping_module] = array_merge($result[$shipping_module], $shipping_type);
} else {
$result[$shipping_module] = $shipping_type;
}
}
return $result;
}
private function auth()
{
if (!isset($this->request->get['key'])