本文介绍了Magento单页结帐saveOrder 302重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行新的Magento 1.8安装并在一页结帐中,当用户提交订单时,在最终审阅时,有一个.此请求的状态码为302,响应为null(应为{"success":true,"error":false}).

Running a new Magento 1.8 install and on the onepage checkout, at the final review when the user submits the order, there's an ajax request for http://www.domain.com/checkout/onepage/saveOrder/. The status code for this request is 302 Found and the response is null (and it should be {"success":true,"error":false}).

我不知道当它应该是200状态时如何获得302.有什么想法吗?

I don't know how it gets a 302 when it should be a 200 status. Any ideas?

推荐答案

在为我修复了该提示.从本质上看,他们似乎忘记了在saveOrder ajax请求中包含formKey.

Ran across this tip that fixed it for me. Essentially it looks like they forgot to include the formKey in the saveOrder ajax request.

找到app / design / frontend / (template name) / template / checkout / onepage / review / info.phtml并替换第60行...

Find app / design / frontend / (template name) / template / checkout / onepage / review / info.phtml and around line number 60 replace...

    <script type="text/javascript">
        //<![CDATA[
            review = new Review('<?php echo $this->getUrl('checkout/onepage/saveOrder') ?>', '<?php echo $this->getUrl('checkout/onepage/success') ?>', $('checkout-agreements'));
        //]]>
    </script>

...与此...

    <script type="text/javascript">
    //<![CDATA[
        review = new Review('<?php echo $this->getUrl('checkout/onepage/saveOrder', array('form_key' => Mage::getSingleton('core/session')->getFormKey())) ?>', '<?php echo $this->getUrl('checkout/onepage/success') ?>', $('checkout-agreements'));
    //]]>
    </script>

这篇关于Magento单页结帐saveOrder 302重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 04:48
查看更多