1

我正在使用 lotusbreath 一步结帐。它在本地主机上工作正常,但在服务器上上传后无法正常工作。

在服务器下订单按钮未重定向到订单成功页面。

两个地方(服务器和本地主机)都有相同的文件,所以我不明白该怎么做。

有人可以帮我做什么吗?

这是服务器上结帐页面的链接:this

这是下订单按钮的验证

   public function saveOrderAction()
 {
if (!$this->_validateFormKey()) {
    $this->_redirect('*/*');
    return;
}

if ($this->_expireAjax()) {
    return;
}

$result = array();
try {
    $requiredAgreements = Mage::helper('checkout')->getRequiredAgreementIds();
    if ($requiredAgreements) {
        $postedAgreements = array_keys($this->getRequest()->getPost('agreement', array()));
        $diff = array_diff($requiredAgreements, $postedAgreements);
        if ($diff) {
            $result['success'] = false;
            $result['error'] = true;
            $result['error_messages'] = $this->__('Please agree to all the terms and conditions before placing the order.');
            $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
            return;
        }
    }

    $data = $this->getRequest()->getPost('payment', array());
    if ($data) {
        $data['checks'] = Mage_Payment_Model_Method_Abstract::CHECK_USE_CHECKOUT
            | Mage_Payment_Model_Method_Abstract::CHECK_USE_FOR_COUNTRY
            | Mage_Payment_Model_Method_Abstract::CHECK_USE_FOR_CURRENCY
            | Mage_Payment_Model_Method_Abstract::CHECK_ORDER_TOTAL_MIN_MAX
            | Mage_Payment_Model_Method_Abstract::CHECK_ZERO_TOTAL;
        $this->getOnepage()->getQuote()->getPayment()->importData($data);
    }

    $this->getOnepage()->saveOrder();

    $redirectUrl = $this->getOnepage()->getCheckout()->getRedirectUrl();
    $result['success'] = true;
    $result['error']   = false;
} catch (Mage_Payment_Model_Info_Exception $e) {
    $message = $e->getMessage();
    if (!empty($message)) {
        $result['error_messages'] = $message;
    }
    $result['goto_section'] = 'payment';
    $result['update_section'] = array(
        'name' => 'payment-method',
        'html' => $this->_getPaymentMethodsHtml()
    );
} catch (Mage_Core_Exception $e) {
    Mage::logException($e);
    Mage::helper('checkout')->sendPaymentFailedEmail($this->getOnepage()->getQuote(), $e->getMessage());
    $result['success'] = false;
    $result['error'] = true;
    $result['error_messages'] = $e->getMessage();

    $gotoSection = $this->getOnepage()->getCheckout()->getGotoSection();
    if ($gotoSection) {
        $result['goto_section'] = $gotoSection;
        $this->getOnepage()->getCheckout()->setGotoSection(null);
    }
    $updateSection = $this->getOnepage()->getCheckout()->getUpdateSection();
    if ($updateSection) {
        if (isset($this->_sectionUpdateFunctions[$updateSection])) {
            $updateSectionFunction = $this->_sectionUpdateFunctions[$updateSection];
            $result['update_section'] = array(
                'name' => $updateSection,
                'html' => $this->$updateSectionFunction()
            );
        }
        $this->getOnepage()->getCheckout()->setUpdateSection(null);
    }
} catch (Exception $e) {
    Mage::logException($e);
    Mage::helper('checkout')->sendPaymentFailedEmail($this->getOnepage()->getQuote(), $e->getMessage());
    $result['success']  = false;
    $result['error']    = true;
    $result['error_messages'] = $this->__('There was an error processing your order. Please contact us or try again later.');
}
$this->getOnepage()->getQuote()->save();
4

0 回答 0