首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Opencart中的签出验证在哪里?

Opencart中的签出验证在哪里?
EN

Stack Overflow用户
提问于 2013-08-16 22:36:45
回答 2查看 4.1K关注 0票数 3

我遇到的问题是,在“传递方法”部分,Ajax由于某些原因而无法验证。

在下面的代码中(来自签出/checkout.tpl),BeforeSend和complete函数正在启动,但是成功中的函数并不是关闭的。

有人能告诉我'index.php?route=checkout/shipping_method/validate‘在哪里吗?

谢谢

代码语言:javascript
复制
$('#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">&nbsp;<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 &raquo;</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);
      }
   });   
});
EN

回答 2

Stack Overflow用户

发布于 2013-08-16 22:48:00

如url所示,控制器结构是您可以在名称为validate的类中找到的ControllerCheckoutShippingMethod函数,该类位于

catalog\controller\checkout\shipping_method.php

票数 4
EN

Stack Overflow用户

发布于 2016-06-03 11:40:07

签出使用许多页面,因为Ajax是

代码语言:javascript
复制
url: 'index.php?route=checkout/shipping_method/validate',

它通过函数验证从页面签出/传送_Method.php中检索数据。 和客人退房

代码语言:javascript
复制
checkout/guest.php    


public function save() {//this function consist validation

checkout/shipping_method.php
checkout/payment_method.php

您可以在firebug中使用控制台进行检查,这将使您清楚地了解通过ajax调用的哪个部分或页面当前正在运行。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18283137

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档