Page 1 of 1

Error on payment method submition

Posted: Wed Feb 20, 2019 2:55 am
by orik3ll0
Hi all,
OC: 2.3.0.2

I am getting jquery error (500) on all payment methods submition on Ajax function call('confirm'). Let`s take as example simple payment method Pay on deliver. On press "Checkout" button i am getting this error https://imgur.com/a/TA5DqZW. Let`s see controller and view
"payment on deliver" controller - COD

Code: Select all

public function confirm() {
	if ($this->session->data['payment_method']['code'] == 'cod') {
		$this->load->model('checkout/order');
		$this->model_checkout_order->addOrderHistory($this->session->data['order_id'], $this->config->get('cod_order_status_id'));
	}
}
Here is ajax form in view:

Code: Select all

<script type="text/javascript"><!--
$('#button-confirm').on('click', function() {
	$.ajax({
		type: 'get',
		url: 'index.php?route=extension/payment/cod/confirm',
		cache: false,
		beforeSend: function() {
			$('#button-confirm').button('loading');
		},
		complete: function() {
			$('#button-confirm').button('reset');
		},
		success: function() {
			location = '<?php echo $continue; ?>';
		}
	});
});
//--></script>
Error comes from function "addOrderHistory". Even if i restore all order.php file to stock, i am getting same error. Function 'addOrderHistory' is working right and inserting all datas to all required tables. But on 2-nd button click(after first one with error) it works and does redirect. How can I fix it? Wheren could be error? I lost 4 days for that and could not find error.
To see an error website is: https://buket.ideart.az
P.S. on stock also jquere 2.1.1

Thank your for attention and help

Re: Error on payment method submition

Posted: Wed Feb 20, 2019 3:59 am
by thekrotek
Error 500 is just a generic error. You need to find out actual error message and copy it here.

Re: Error on payment method submition

Posted: Wed Feb 20, 2019 5:30 am
by paid1234
Check your error log for more infomation and post the log here for more help.

Thanks