sam
sam

Reputation: 337

Checkout page is not working

i am using lotusbreath one step checkout. its work fine on localhost but its not working after uploading on server.

On server place order button is not redirected to order successfully page.

Both place(sever and localhost) has same file, so i doesn't understand what to do.

Can anybody help me what to do?

This is the link of checkout page on server: this

here is the validation of placed order button

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

Upvotes: 1

Views: 568

Answers (0)

Related Questions