mirror of
https://github.com/retailcrm/opencart-module.git
synced 2024-11-22 13:16:07 +03:00
back
This commit is contained in:
parent
6a9b2a7e59
commit
bcd319df05
@ -47,27 +47,11 @@ class ControllerApiRetailcrm extends Controller
|
||||
);
|
||||
|
||||
foreach ($shippingModules as $shippingModule) {
|
||||
|
||||
$this->load->model('extension/shipping/' . $shippingModule['code']);
|
||||
|
||||
if ($this->config->get($shippingModule['code'] . '_status')) {
|
||||
if($this->{'model_extension_shipping_' . $shippingModule['code']}->getQuote($address)) {
|
||||
$method_data = $this->{'model_extension_shipping_' . $shippingModule['code']}->getQuote($address);
|
||||
if($method_data['quote']) {
|
||||
$quote_data[] = $method_data;
|
||||
} else {
|
||||
$this->load->language('extension/shipping/' . $shippingModule['code']);
|
||||
$quote_data[] = array(
|
||||
'code' => $shippingModule['code'],
|
||||
'title' => $this->language->get('text_title')
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$this->load->language('extension/shipping/' . $shippingModule['code']);
|
||||
$quote_data[] = array(
|
||||
'code' => $shippingModule['code'],
|
||||
'title' => $this->language->get('text_title')
|
||||
);
|
||||
$quote_data[] = $this->{'model_extension_shipping_' . $shippingModule['code']}->getQuote($address);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -76,15 +60,12 @@ class ControllerApiRetailcrm extends Controller
|
||||
$deliveryTypes = array();
|
||||
|
||||
foreach ($quote_data as $shipping) {
|
||||
if(isset($shipping['quote']) && !empty($shipping['quote'])){
|
||||
|
||||
foreach ($shipping['quote'] as $shippingMethod) {
|
||||
$deliveryTypes[$shipping['code']]['title'] = $shipping['title'];
|
||||
$deliveryTypes[$shipping['code']][$shippingMethod['code']] = $shippingMethod;
|
||||
}
|
||||
} else {
|
||||
$deliveryTypes[$shipping['code']]['title'] = $shipping['title'];
|
||||
$deliveryTypes[$shipping['code']][$shipping['code']] = $shipping;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $deliveryTypes;
|
||||
|
Loading…
Reference in New Issue
Block a user