Php Opencart中的签出验证在哪里
我遇到的问题是,在“交付方法”一节中,Ajax由于某种原因无法验证 在下面的代码中(来自checkout/checkout.tpl),BeforeSend和complete函数正在启动,但是success中的函数没有启动 谁能告诉我'index.php?route=checkout/shipping\u method/validate'设置在哪里 多谢各位Php Opencart中的签出验证在哪里,php,jquery,opencart,Php,Jquery,Opencart,我遇到的问题是,在“交付方法”一节中,Ajax由于某种原因无法验证 在下面的代码中(来自checkout/checkout.tpl),BeforeSend和complete函数正在启动,但是success中的函数没有启动 谁能告诉我'index.php?route=checkout/shipping\u method/validate'设置在哪里 多谢各位 $('#button-shipping-method').live('click', function() { $.ajax({
$('#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);
}
});
});
$(“#按钮运送方法”).live('click',function(){
$.ajax({
url:'index.php?route=checkout/shipping\u method/validate',
键入:“post”,
数据:$('shipping method input[type='radio\']:选中,'shipping method textarea'),
数据类型:“json”,
beforeSend:function(){
$(“#按钮运送方法”).attr('disabled',true);
$(“#按钮装运方式”)。在(“”)之后;
},
完成:函数(){
$(“#按钮运送方法”).attr('disabled',false);
$('.wait').remove();
},
成功:函数(json){
$('.warning,.error').remove();
if(json['redirect']){
location=json['redirect'];
}else if(json['error']){
如果(json['error']['warning']){
$('#shipping method.checkout content').prepend(''+json['error']['warning']+'');
$('.warning').fadeIn('slow');
}
}否则{
$.ajax({
url:'index.php?route=checkout/payment_method',
数据类型:“html”,
成功:函数(html){
$(“#付款方式.结帐内容”).html(html);
$('#shipping method.checkout content').slideUp('slow');
$(“#付款方式.结帐内容”).slideDown('slow');
$(“#装运方法.签出标题a”).remove();
$(“#付款方式.签出标题a”).remove();
$(“#shipping method.checkout heading”).append('Modify»;');
},
错误:函数(xhr、ajaxOptions、thrownError){
警报(thrownError+“\r\n”+xhr.statusText+“\r\n”+xhr.responseText);
}
});
}
},
错误:函数(xhr、ajaxOptions、thrownError){
警报(thrownError+“\r\n”+xhr.statusText+“\r\n”+xhr.responseText);
}
});
});
因为url显示了控制器结构,验证
函数可以在位于
catalog\controller\checkout\shipping\u method.php
签出使用多页
正如您的ajaxurl一样
它使用函数从页面checkout/shipping_method.php检索数据
验证
及
客人结账
您可以使用firebug中的控制台进行检查,这将使您更加清楚
关于通过ajax调用的节或页当前正在运行
没有错误。只是没有进入结帐的下一个阶段
url: 'index.php?route=checkout/shipping_method/validate',
checkout/guest.php
public function save() {//this function consist validation
checkout/shipping_method.php
checkout/payment_method.php