mirror of
https://github.com/retailcrm/opencart-module.git
synced 2024-11-22 13:16:07 +03:00
update: admin/controller/extension/module/retailcrm.php
update: admin/language/en-gb/extension/module/retailcrm.php update: admin/language/ru-ru/extension/module/retailcrm.php update: admin/model/extension/retailcrm/order.php update: admin/view/template/extension/module/retailcrm.tpl
This commit is contained in:
parent
a84925fd19
commit
0c4d2a577e
@ -127,7 +127,9 @@ class ControllerExtensionModuleRetailcrm extends Controller
|
||||
'text_button_export_order',
|
||||
'text_button_catalog',
|
||||
'text_success_catalog',
|
||||
'retailcrm_upload_order'
|
||||
'retailcrm_upload_order',
|
||||
'text_error_order',
|
||||
'text_error_order_id'
|
||||
);
|
||||
|
||||
$this->load->model('extension/extension');
|
||||
@ -322,9 +324,10 @@ class ControllerExtensionModuleRetailcrm extends Controller
|
||||
$data['order_status'] = $status['retailcrm_status'][$data['order_status_id']];
|
||||
|
||||
$this->load->model('extension/retailcrm/order');
|
||||
$this->model_extension_retailcrm_order->uploadOrder($data);
|
||||
$result = $this->model_extension_retailcrm_order->uploadOrder($data);
|
||||
}
|
||||
|
||||
echo json_encode($result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -22,6 +22,9 @@ $_['text_button_export'] = 'Unload all orders and customers';
|
||||
$_['text_button_export_order'] = 'Unload order';
|
||||
$_['text_button_catalog'] = 'Unload catalog';
|
||||
$_['text_success_catalog'] = 'Catalog successfully unloaded';
|
||||
$_['text_error_order'] = 'Error! Order is not unloaded!';
|
||||
$_['text_error_order_id'] = 'Error! Enter the correct order number!';
|
||||
|
||||
|
||||
$_['retailcrm_dict_delivery'] = 'Shipment methods';
|
||||
$_['retailcrm_dict_status'] = 'Order statuses';
|
||||
|
@ -22,6 +22,8 @@ $_['text_button_export'] = 'Выгрузить все заказы и к
|
||||
$_['text_button_export_order'] = 'Выгрузить заказ';
|
||||
$_['text_button_catalog'] = 'Выгрузить каталог';
|
||||
$_['text_success_catalog'] = 'Каталог успешно выгружен';
|
||||
$_['text_error_order'] = 'Ошибка! Заказ не выгружен!';
|
||||
$_['text_error_order_id'] = 'Ошибка! Введите корректный номер заказа!';
|
||||
|
||||
$_['retailcrm_dict_delivery'] = 'Способы доставки';
|
||||
$_['retailcrm_dict_status'] = 'Статусы';
|
||||
|
@ -58,8 +58,10 @@ class ModelExtensionRetailcrmOrder extends Model {
|
||||
|
||||
unset($customers);
|
||||
|
||||
$this->retailcrm->ordersCreate($order);
|
||||
$result = $this->retailcrm->ordersCreate($order);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
private function process($order_data) {
|
||||
|
@ -171,20 +171,33 @@
|
||||
});
|
||||
|
||||
$('#export_order').on('click', function() {
|
||||
var order_id = $('input[name=\'order_id\']').val();
|
||||
if (order_id && order_id > 0) {
|
||||
$.ajax({
|
||||
url: '<?php echo $catalog; ?>'+'admin/index.php?route=extension/module/retailcrm/exportOrder&token=' + token + '&order_id=' + $('input[name=\'order_id\']').val(),
|
||||
url: '<?php echo $catalog; ?>'+'admin/index.php?route=extension/module/retailcrm/exportOrder&token=' + token + '&order_id=' + order_id,
|
||||
beforeSend: function() {
|
||||
$('#export_order').button('loading');
|
||||
},
|
||||
complete: function(json) {
|
||||
error: function(xhr, ajaxOptions, thrownError) {
|
||||
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
},
|
||||
success: function(data, textStatus, jqXHR) {
|
||||
if (jqXHR['responseText'] == 'false') {
|
||||
$('.alert-success').remove();
|
||||
$('#content > .container-fluid').prepend('<div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i><?php echo $text_error_order; ?></div>');
|
||||
$('#export_order').button('reset');
|
||||
} else {
|
||||
$('.alert-success').remove();
|
||||
$('#content > .container-fluid').prepend('<div class="alert alert-success"><i class="fa fa-exclamation-circle"></i><?php echo $text_success_export_order; ?></div>');
|
||||
$('#export_order').button('reset');
|
||||
},
|
||||
error: function(xhr, ajaxOptions, thrownError) {
|
||||
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
$('input[name=\'order_id\']').val('');
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
} else {
|
||||
$('.alert-success').remove();
|
||||
$('#content > .container-fluid').prepend('<div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> <?php echo $text_error_order_id; ?></div>');
|
||||
$('#export_order').button('reset');
|
||||
}
|
||||
});
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user