且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Magento单页结帐saveOrder 302重定向

更新时间:2021-11-07 04:10:25

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>