我正在opencart中开发一个简单的网站,我需要在结帐时删除一个不同的步骤。客户只需结账并填写账户信息即可确认结账或直接结账。
在checkout.php上修改:
$.ajax({
url: 'index.php?route=checkout/payment_method',
dataType: 'html',
success: function(html) {
$('#collapse-payment-method .panel-body').html(html);
$('#collapse-payment-method').parent().find('.panel-heading .panel-title').html('<a href="#collapse-payment-method" data-toggle="collapse" data-parent="#accordion" class="accordion-toggle"><?php echo $text_checkout_payment_method; ?> <i class="fa fa-caret-down"></i></a>');
$('a[href=\'#collapse-payment-method\']').trigger('click');
$('#button-payment-method').trigger('click');
$('#collapse-checkout-confirm').parent().find('.panel-heading .panel-title').html('<?php echo $text_checkout_confirm; ?>');
//$('a[href=\'#collapse-checkout-confirm\']').trigger('click');
},
error: function(xhr, ajaxOptions, thrownError) {
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
它有效,但我怎样才能以更好的方式解决它?