【发布时间】:2017-11-16 03:25:09
【问题描述】:
首先感谢您抽出宝贵的时间来帮助我。
我的情况 -
我正在使用 Opencart 2.1.0.1
货到付款方式
自定义 OnePageCheckout
自定义主题
我已经实现了一个自定义流程,该流程通过每分钟运行的 cron 作业从我们自己的数据库中验证客户。
这是 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>
因为我想在成功结帐后将客户重定向到以下页面。 https://www.myopencartstore.com/confirm.php?order_id=$order_id
必需的操作:我想在上面以粗体突出显示的 url 参数中传递 order_id 变量。
我的修改代码 -
<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>
请帮助如何做同样的事情。
我想绕过结帐/成功页面。
我已经尝试实现 $this->session->data['order_id']; 来获取订单 ID 参数。
我已经尽了最大的努力,因此我能做的最大的事情就是只是重定向到所需的页面,但没有任何参数。
【问题讨论】:
-
你有没有尝试过?请显示您的步骤
标签: php opencart opencart2.x opencart-module