मैं Onepage चेकआउट में समीक्षा चरण कैसे निकाल सकता हूं?


12

मुझे भुगतान विधि चरण के बाद संसाधित होने का आदेश चाहिए, Reviewजो ओनपेज चेकआउट में कदम छोड़ रहा है ।

क्या कोई ऐसा व्यक्ति है जिसके पास इसका अनुभव है या जो मुझे सही दिशा में इंगित कर सकता है कि यह कैसे करना है?

धन्यवाद


2
FYI करें: यह आने वाले देशों में अवैध है।
user487772

मैंने भुगतान के साथ होने के लिए समीक्षा चरण को बदल दिया है, इसलिए उपयोगकर्ता एक चरण में भुगतान की समीक्षा कर सकता है। इस वर्कफ़्लो को बदलने के लिए कुछ विचार?
एडुआर्डो लूज

: मैं इस प्रक्रिया का एक बहुत अच्छी व्याख्या हो पाया excellencemagentoblog.com/...
ryaan_anthony

जवाबों:


9

एक के लिए आपको Mage_Checkout_Block_Onepage :: _ getStepCodes () लिखना होगा

 /**
 * Get checkout steps codes
 *
 * @return array
 */
protected function _getStepCodes()
{
    /**
     * Originally these were 'login', 'billing', 'shipping', 'shipping_method', 'payment', 'review'
     *
     * Stripping steps here has an influence on the entire checkout. There are more instances of the above list
     * among which the opcheckout.js file. Changing only this method seems to do the trick though.
     */
    if ($this->getQuote()->isVirtual()) {
        return array('login', 'billing', 'payment');
    }
    return array('login', 'billing', 'shipping', 'shipping_method', 'payment');
}

फिर वह भाग होता है जहाँ आप एक घटना पर्यवेक्षक के माध्यम से भुगतान के चरण के बाद अपना ऑर्डर बचाना चाहते हैं:

/**
 * THIS METHOD IMMEDIATELY FORWARDS TO THE SAVE ORDER ACTION AFTER THE PAYMENT METHOD ACTION
 *
 * Save the order after having saved the payment method
 *
 * @event controller_action_postdispatch_checkout_onepage_savePayment
 *
 * @param $observer Varien_Event_Observer
 */
public function saveOrder($observer)
{
    /** @var $controllerAction Mage_Checkout_OnepageController */
    $controllerAction = $observer->getEvent()->getControllerAction();
    /** @var $response Mage_Core_Controller_Response_Http */
    $response = $controllerAction->getResponse();

    /**
     * jsonDecode is used because the response of the XHR calls of onepage checkout is always formatted as a json
     * string. jesonEncode is used after the response is manipulated.
     */
    $paymentResponse = Mage::helper('core')->jsonDecode($response->getBody());
    if (!isset($paymentResponse['error']) || !$paymentResponse['error']) {
        /**
         * If there were no payment errors, immediately forward to saving the order as if the user had confirmed it
         * on the review page.
         */
        $controllerAction->getRequest()->setParam('form_key', Mage::getSingleton('core/session')->getFormKey());

        /**
         * Implicitly agree with the terms and conditions by confirming the order
         */
        $controllerAction->getRequest()->setPost('agreement', array_flip(Mage::helper('checkout')->getRequiredAgreementIds()));

        $controllerAction->saveOrderAction();
        /**
         * jsonDecode is used because the response of the XHR calls of onepage checkout is always formatted as a json
         * string. jesonEncode is used after the response is manipulated.
         *
         * $response has here become the response of the saveOrderAction()
         */
        $orderResponse = Mage::helper('core')->jsonDecode($response->getBody());
        if ($orderResponse['error'] === false && $orderResponse['success'] === true) {
            /**
             * Check for redirects here. If there are redirects than a module such as Adyen wants to redirect to a
             * payment page instead of the success page after saving the order.
             */
            if (!isset($orderResponse['redirect']) || !$orderResponse['redirect']) {
                $orderResponse['redirect'] = Mage::getUrl('*/*/success');
            }
            $controllerAction->getResponse()->setBody(Mage::helper('core')->jsonEncode($orderResponse));
        }
    }
}

उपर्युक्त प्रेक्षक विधि का तात्पर्य नियम और शर्तों से है। यह कुछ देशों में अवैध है और आप भुगतान विधि पृष्ठ पर शर्तों को प्रदर्शित करना और सहमत पोस्ट फ़ील्ड को पास करना चाहते हैं।

इसके अलावा, आप opcheckout.js पर एक नज़र रखना चाह सकते हैं ताकि यह सुनिश्चित हो सके कि लोग ऑर्डर फॉर्म को दो बार पोस्ट नहीं कर सकते ... आदि।

यह सिर्फ आपको सही दिशा में इंगित करने के लिए है। यह एक पूर्ण समाधान नहीं है क्योंकि सटीक कार्यान्वयन आपके ग्राहक की इच्छाओं पर निर्भर करता है और मैं आपको समाधान के विवरण का पता लगाने का मज़ा लूटना नहीं चाहता। लेकिन आप पूरी तरह से फंस गए हैं, कृपया हमें बताएं।


कैसे एक पर्यवेक्षक बनाने के लिए?
अक्षय तरु

क्या आप पर्यवेक्षक बनाने के लिए पोस्ट को संपादित कर सकते हैं?
अक्षय तरु

नाइस राइट अप - आपके कॉल करने से पहले फॉर्म कुंजी को रिफ्रेश करके कंट्रोलर एक्सटेंशन के साथ भी संभव है saveOrderAction(), फिर अपने ऑब्जर्वर मेथड के अनुसार रिस्पांस हैंडलिंग को जोड़ दें।
रोबी एवरिल

0

अपनी घटना का अवलोकन करने के लिए:

<controller_action_postdispatch_checkout_onepage_savePayment> <observers> <Name_Event_Observer> <class>module/observer</class> <method>method</method> </Name_Event_Observer> </observers> </controller_action_postdispatch_checkout_onepage_savePayment>


हमारी साइट का प्रयोग करके, आप स्वीकार करते हैं कि आपने हमारी Cookie Policy और निजता नीति को पढ़ और समझा लिया है।
Licensed under cc by-sa 3.0 with attribution required.