首页>Magento>source

您好我们最近在Magento 1.9.0.1上看到了这个错误.不知道为什么.特别是在哪里查看如何调试.

T& C已经在后端启用了.并且设置了1个协议(ID = 1).如果我们取消选中或检查协议,则无关紧要.错误始终是。

Please agree to all the terms and conditions before placing the order

然而,我们看到AJAX流量正在运行,这与服务器端相关.这让它更有趣.

回应是 {"success":false,"error":true,"error_messages":"Please agree to all the terms and conditions before placing the order."}

我看到这条消息来自 $this->_getCheckoutSession()->addError($this->__('Please agree to all Terms and Conditions before placing the order.'));   在OnepageController.php(function:overviewPostAction())...有一个差异...但不知道为什么它不成功.然而,我确实看到它是作为 name="agreement[<?php echo $_a->getId()?>]"提交的 并使用 $postedAgreements = array_keys($this->getRequest()->getPost('agreement', array()));处理

更新:似乎协议变量在POST中作为 agreement[2]:1发送   但我不认为 $this->getRequest()->getPost('agreement', array())   然后会捕捉它的value。

Question :这是一个已知错误吗? 如果有,是否有方法可以解决?

感谢任何提示; P

最新回答
  • 2019-12-5
    1 #

    我也有同样的问题.经过一番深挖,我才开始工作。 在opcheckout.js中,您可以找到以下代码

             var params = Form.serialize(payment.form);
              if (this.agreementsForm) {
                  params += '&'+Form.serialize(this.agreementsForm);
              }
    

    "this.agreementsForm"返回协议表单值,但在Form.serialize(this.agreementsForm)中,我得到了空值。

    所以在checkout / onepage / review / info.phtml中 找到这一行

    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'));
    

    并替换为

    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');
    

  • 2019-12-5
    2 #

    不知道为什么,但......移动协议块打破了这一切......只是测试并重新测试了这个......

    这是有效的

    <div id="checkout-review-submit">
        <?php echo $this->getChildHtml('agreements') /** CUSTOM CODE SNH - DONT MOVE IT WILL BREAK **/?>
        <div class="buttons-set" id="review-buttons-container">
            <p class="f-left">
            <?php echo $this->__('Forgot an Item?') ?> <a href="<?php echo $this->getUrl('checkout/cart') ?>"><?php echo $this->__('Edit Your Cart') ?></a><br/>
            /p>
            <?php echo $this->getChildHtml('button') ?>
    

    这不是

       <div id="checkout-review-submit">
            <div class="buttons-set" id="review-buttons-container">
                <p class="f-left">
                <?php echo $this->__('Forgot an Item?') ?> <a href="<?php echo $this->getUrl('checkout/cart') ?>"><?php echo $this->__('Edit Your Cart') ?></a><br/>
    <?php echo $this->getChildHtml('agreements') /** CUSTOM CODE SNH - DONT MOVE IT WILL BREAK **/?>
                /p>
                <?php echo $this->getChildHtml('button') ?>
    

  • ee 1.14.2.2:“请等待” 在创建类别Magento 11423时卡住了页面
  • base url:Magento2:重复商店 - base_url问题