Update some columns sale/order from admin
Posted: Sun Nov 18, 2018 6:12 pm
Hello guys,
From admin panel orders page, i press see order button( "sale/order/info" page) and i have added 1 more "select" input and on submit button, i want to send this "select" input value and update this value in db, but can not find in which file it does insert and update of tables.
It sends data by ajax on button click
okay, i am adding my select input inside <form> tag and adding my value tot data
So on submit it does insert into `prefix_order_history` and updates `order_status_id`.... I can not find model where it does this insert and update to change query. Please tell me where can i find query
From admin panel orders page, i press see order button( "sale/order/info" page) and i have added 1 more "select" input and on submit button, i want to send this "select" input value and update this value in db, but can not find in which file it does insert and update of tables.
It sends data by ajax on button click
Code: Select all
$('#button-history').on('click', function() {
$.ajax({
url: '<?php echo $catalog; ?>index.php?route=api/order/history&token=' + token + '&store_id=<?php echo $store_id; ?>&order_id=<?php echo $order_id; ?>',
type: 'post',
dataType: 'json',
data: 'order_status_id=' + encodeURIComponent($('select[name=\'order_status_id\']').val()) + '¬ify=' + ($('input[name=\'notify\']').prop('checked') ? 1 : 0) + '&override=' + ($('input[name=\'override\']').prop('checked') ? 1 : 0) + '&append=' + ($('input[name=\'append\']').prop('checked') ? 1 : 0) + '&comment=' + encodeURIComponent($('textarea[name=\'comment\']').val()),
beforeSend: function() {
$('#button-history').button('loading');
},
complete: function() {
$('#button-history').button('reset');
},
success: function(json) {
//alert(data);
$('.alert').remove();
if (json['error']) {
$('#history').before('<div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> ' + json['error'] + ' <button type="button" class="close" data-dismiss="alert">×</button></div>');
}
if (json['success']) {
$('#history').load('index.php?route=sale/order/history&token=<?php echo $token; ?>&order_id=<?php echo $order_id; ?>');
$('#history').before('<div class="alert alert-success"><i class="fa fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="close" data-dismiss="alert">×</button></div>');
$('textarea[name=\'comment\']').val('');
}
},
error: function(xhr, ajaxOptions, thrownError) {
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
});
Code: Select all
data: 'seller_sel=' + encodeURIComponent($('select[name=\'seller_sel\']').val()) + 'order_status_id=' + encodeURIComponent($('select[name=\'order_status_id\']').val()) + '¬ify=' + ($('input[name=\'notify\']').prop('checked') ? 1 : 0) + '&override=' + ($('input[name=\'override\']').prop('checked') ? 1 : 0) + '&append=' + ($('input[name=\'append\']').prop('checked') ? 1 : 0) + '&comment=' + encodeURIComponent($('textarea[name=\'comment\']').val()),