進行檢驗驗證時遇到的問題是,在「分配方法」一節中,阿賈克斯未能驗證某種原因。哪裏是在Opencart的
在下面的代碼(從結帳/ checkout.tpl),則BeforeSend和完整功能被髮射了,但在成功的功能不點火關閉。
誰能告訴我在哪裏 '的index.php?路徑=結賬/ SHIPPING_METHOD /驗證' 設置?
謝謝
$('#button-shipping-method').live('click', function() {
$.ajax({
url: 'index.php?route=checkout/shipping_method/validate',
type: 'post',
data: $('#shipping-method input[type=\'radio\']:checked, #shipping-method textarea'),
dataType: 'json',
beforeSend: function() {
$('#button-shipping-method').attr('disabled', true);
$('#button-shipping-method').after('<span class="wait"> <img src="catalog/view/theme/default/image/loading.gif" alt="" /></span>');
},
complete: function() {
$('#button-shipping-method').attr('disabled', false);
$('.wait').remove();
},
success: function(json) {
$('.warning, .error').remove();
if (json['redirect']) {
location = json['redirect'];
} else if (json['error']) {
if (json['error']['warning']) {
$('#shipping-method .checkout-content').prepend('<div class="warning" style="display: none;">' + json['error']['warning'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');
$('.warning').fadeIn('slow');
}
} else {
$.ajax({
url: 'index.php?route=checkout/payment_method',
dataType: 'html',
success: function(html) {
$('#payment-method .checkout-content').html(html);
$('#shipping-method .checkout-content').slideUp('slow');
$('#payment-method .checkout-content').slideDown('slow');
$('#shipping-method .checkout-heading a').remove();
$('#payment-method .checkout-heading a').remove();
$('#shipping-method .checkout-heading').append('<a>Modify »</a>');
},
error: function(xhr, ajaxOptions, thrownError) {
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
}
},
error: function(xhr, ajaxOptions, thrownError) {
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
});
什麼錯誤出現 –
沒有錯誤。只是不會進入結賬的下一個階段 –