dongshuzhuo5659 2011-09-03 12:17
浏览 53
已采纳

Magento OnePage Checkout中的下订单失败

I have a Magento store that has been converted to a "one deal at a time" type store, and the checkout process is broken. I've been trying to debug this, but have hit a wall, primarily due to my limited understanding of Magento.

On the saveOrder step, when clicking "Place Order", the page shows "submitting order information, then the message clears and the shopper is still on the Order Review page.

I've analyzed with Firebug and HttpFox, and I can see the order information is being sent

(Request-Line)  POST /checkout/onepage/saveOrder/ HTTP/1.1
Host    www.domainname.com
User-Agent  Mozilla/5.0 (Windows NT 6.0; rv:2.0) Gecko/20100101 Firefox/4.0
Accept  text/javascript, text/html, application/xml, text/xml, */*
Accept-Language en-us,en;q=0.5
Accept-Encoding gzip, deflate
Accept-Charset  ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive  115
Connection  keep-alive
X-Requested-With    XMLHttpRequest
X-Prototype-Version 1.6.0.3
Content-Type    application/x-www-form-urlencoded; charset=UTF-8
Referer https://www.domainname.com/checkout/onepage/
Content-Length  178
Cookie  frontend=cd60252d28cd115d4096cb2bb5b6a043
Pragma  no-cache
Cache-Control   no-cache

Post Data shows all of the required information:

payment[method] authorizenet
payment[cc_type]    VI
payment[cc_number]  4111111111111111
payment[cc_exp_month]   5
payment[cc_exp_year]    2012
payment[cc_cid] 987

My problem seemed similar to this post: http://fishpig.co.uk/magento-tutorials/magento-checkout-error-undefined-javascript-alert

but I'm not getting an "Undefined" alert, so I added the "else" statement below:

nextStep: function(transport){
    if (transport && transport.responseText) {
            alert(transport.responseText);
        try{
            response = eval('(' + transport.responseText + ')');
        }
        catch (e) {
            response = {};
        }
        if (response.redirect) {
            location.href = response.redirect;
            return;
        }
        if (response.success) {
            this.isSuccess = true;
            window.location=this.successUrl;
        }
        else{
            var msg = response.error_messages;
            if (typeof(msg)=='object') {
                msg = msg.join("
");
            }
            alert(msg);
        }

        if (response.update_section) {
            $('checkout-'+response.update_section.name+'-load').update(response.update_section.html);
            response.update_section.html.evalScripts();
        }

        if (response.goto_section) {
            checkout.gotoSection(response.goto_section);
            checkout.reloadProgressBlock();
        }
    } else {
        alert('transport.responseText');
        }
},

I am getting the JS alert with no text, so it looks like transport.reponseText is empty. The main references to empty response text I've found appear to be related to same-origin policy, which I don't think applies, because my AJAX post is to and from www.domainname.com.

When I call the saveOrder function directly in the browser, I'm receiving a valid response:

https://www.domainname.com/checkout/onepage/saveOrder {"success":false,"error":true,"error_messages":"Credit card number mismatch with credit card type"}

and HTTPFox shows I'm getting a 200 response from the Ajax call, but the responsetext is simply empty. I find no PHP errors or errors in Magento's exceptions log. The only thing I'm finding that might be related is "Headers already sent' in Magento's system log:

</pre>
2011-09-03T12:14:21+00:00 DEBUG (7): HEADERS ALREADY SENT: <pre>[0] wwwroot/app/code/core/Mage/Core/Controller/Response/Http.php:50
[1] wwwroot/lib/Zend/Controller/Response/Abstract.php:726
[2] wwwroot/app/code/core/Mage/Core/Controller/Response/Http.php:82
[3] wwwroot/app/code/core/Mage/Core/Controller/Varien/Front.php:169
[4] wwwroot/app/Mage.php:459
[5] wwwroot/index.php:67
</pre>

Does anyone have any suggestions why else the responseText is coming back empty?

  • 写回答

1条回答 默认 最新

  • dongmoyu0336 2012-12-27 01:52
    关注

    Custom modules were at fault. Disabling all of the custom modules in the Magento admin does not actually disable them, it only "disables their output".

    Setting False in the module configuration resolved the invalid headers error, at which point I was able to debug the custom module issue that was causing the AJAX checkout errors.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试
  • ¥20 问题请教!vue项目关于Nginx配置nonce安全策略的问题
  • ¥15 教务系统账号被盗号如何追溯设备
  • ¥20 delta降尺度方法,未来数据怎么降尺度
  • ¥15 c# 使用NPOI快速将datatable数据导入excel中指定sheet,要求快速高效
  • ¥15 再不同版本的系统上,TCP传输速度不一致
  • ¥15 高德地图2.0 版本点聚合中Marker的位置无法实时更新,如何解决呢?
  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题