First of all thank you for giving your valuable time to help me.
My Situation -
I am using Opencart 2.1.0.1
Cash on Delivery Payment Method
Custom OnePageCheckout
Custom Theme
I have implemented a custom process which verifies the customer from our own database via a cron job running every minute.
This is the default code in Opencart catalog/view/theme/template/payment/cod.tpl
<div class="buttons">
<div class="pull-right">
<input type="button" value="<?php echo $button_confirm; ?>" id="button-confirm" class="btn btn-primary" data-loading-text="<?php echo $text_loading; ?>" />
</div>
</div>
<script type="text/javascript"><!--
$('#button-confirm').on('click', function() {
$.ajax({
type: 'get',
url: 'index.php?route=payment/cod/confirm',
cache: false,
beforeSend: function() {
$('#button-confirm').button('loading');
},
complete: function() {
$('#button-confirm').button('reset');
},
success: function() {
location = '<?php echo $continue; ?>';
}
});
});
//--></script>
As I want to redirect the customer to the following page after successful checkout. https://www.myopencartstore.com/confirm.php?order_id=$order_id
Required Action : I want to pass on the order_id variable in the url parameter as highlighted in bold above.
My Modified Code -
<div class="buttons">
<div class="pull-right">
<input type="button" value="<?php echo $button_confirm; ?>" id="button-confirm" class="btn btn-primary" data-loading-text="<?php echo $text_loading; ?>" />
</div>
</div>
<script type="text/javascript"><!--
$('#button-confirm').on('click', function() {
$.ajax({
type: 'get',
url: 'index.php?route=payment/cod/confirm',
cache: false,
beforeSend: function() {
$('#button-confirm').button('loading');
},
complete: function() {
$('#button-confirm').button('reset');
},
success: function() {
location = '<?php echo 'confirm-success.php'; ?>';
}
});
});
//--></script>
Please help how to do the same.
I want to bye-pass the checkout/success page.
I've tried implementing $this->session->data['order_id']; to get the Order ID parameter.
I've tried all my efforts and thus maximum I could do is to just redirect to the desired page but without any parameters.