- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我的 Magento 商店已转换为“一次交易”类型的商店,并且结帐流程中断。我一直在尝试对此进行调试,但遇到了瓶颈,主要是因为我对 Magento 的了解有限。
saveOrder步骤,点击“Place Order”时,页面显示“正在提交订单信息,然后消息消失,购物者仍在Order Review页面。”
我用Firebug和HttpFox分析过,可以看到正在发送订单信息
(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 显示所有必需的信息:
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
我的问题似乎与这篇文章类似: http://fishpig.co.uk/magento-tutorials/magento-checkout-error-undefined-javascript-alert
但我没有收到“未定义”警报,所以我在下面添加了“else”语句:
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("\n");
}
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');
}
},
我收到没有文本的 JS 警报,因此看起来 transport.reponseText 是空的。我发现对空响应文本的主要引用似乎与同源策略有关,我认为这不适用,因为我的 AJAX 帖子是往返于 www.domainname.com。
当我直接在浏览器中调用 saveOrder 函数时,我收到了一个有效的响应:
https://www.domainname.com/checkout/onepage/saveOrder{"success":false,"error":true,"error_messages":"信用卡号与信用卡类型不匹配"}
并且 HTTPFox 显示我从 Ajax 调用中获得了 200 响应,但响应文本只是空的。我在 Magento 的异常日志中没有发现任何 PHP 错误或错误。我发现唯一可能相关的是 Magento 系统日志中的“ header 已发送”:
</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>
有没有人有任何建议,为什么 responseText 返回是空的?
最佳答案
自定义模块有问题。禁用 Magento 管理中的所有自定义模块实际上并没有禁用它们,它只是“禁用它们的输出”。
在模块配置中设置 False 解决了无效 header 错误,此时我能够调试导致 AJAX 校验错误的自定义模块问题。
关于php - 在 Magento OnePage Checkout 中下订单失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7293058/
前文链接: Spring复杂的BeanFactory继承体系该如何理解? ----上 Spring复杂的BeanFactory继承体系该如何理解? ----中 Spring IoC容器 Applica
我正在努力实现这个目标 | Div | |Div nav wrapper| | logo | |con
我正在尝试从下拉菜单中的链接进行模式启动。模态似乎启动了(网站变灰),但看不到。来自不在下拉列表中的常规链接的模式工作得很好。我愚弄了 jquery,但由于我是 jquery 的新手,所以没有任何结果
我是一名优秀的程序员,十分优秀!