Magento Onepage 결제에서 단계를 제거하는 방법?


18

CE 1.7을 사용하고 있으며 현재 Onepage Checkout에서 배송, 배송 방법 및 결제 단계를 제거하려고합니다. 에서 단계를 이미 제거했습니다 local\mage\checkout\block\onepage\abstract.php. 계속 클릭하면 청구 정보에서 검토를 진행하려고 할 때 문제가 발생합니다. 어떤 아이디어라도 대단히 감사하겠습니다.


(아직) 의견을 말할 수 없으므로 CE 1.7에서 지불을 건너 뛰기 위해 (OnepageController.php에서) 한 일에 대해 알려주십시오. 감사.
— heaven7

안녕하세요 @Egregory,이 작업을 수행 한 방법에 대한 추가 정보가 있습니까? 나는 똑같이하려고합니다!
— Edgar Quintero

@edgarQuintero 내가 사용한 코드는 승인 된 답변과 제출 한 코드의 조합입니다. CE 1.7에서이 작업을
— 수행함

@Egregory Yea 나는 Bijal Bhavsar가 게시 한 아래 기능을 다시 작성하고 OnepageController.php 수정 사항, 캐시 및 세션을 삭제했지만 확실하게 변경했지만 여전히 변경 사항은 없습니다. 나는 또한 1.7에 있습니다.
— Edgar Quintero

답변:


13

다음 기능을 사용하여 아래 블록 파일을 다시 작성하십시오.

수업 재 작성 Mage_Checkout_Block_Onepage_Billing

    public function canShip()
    {
        return false;
    }

수업 재 작성 Mage_Checkout_Block_Onepage_Shipping_Method

    public function isShow()
    {
        return false;
    }

수업 재 작성 Mage_Checkout_Block_Onepage_Shipping

    public function isShow()
    {
          return false;
    }

이제 진행과 관련된 문제가 발생하지 않기를 바랍니다.


여전히 Magento의 재 작성 기능을 배우고 있습니다. 이것을 새 모듈에서 만들거나 app ​​\ code \ local 섹션에서 만들 수 있습니까?
— Egregory

새 모듈을 작성하고 파일을 다시 작성해야합니다. 블록 파일을 무시하는 방법? 당신은 검토 할 수 있습니다 inchoo.net/ecommerce/magento/...
— Bijal Bhavsar에게

감사합니다. 모든 것이 알아 났으므로 올바른 변경을 한 후 모든 것이 작동하기 시작한 것을 다시 작성하면 onepagecontroller.php가 전화를 끊었습니다.
— Egregory

@Egregory는 onepagecontroller.php를 공유 할 수 있습니까? 어떻게 작업을 시작하기 위해 변경 했습니까? 감사!
— srdan

그것은 오래되었지만 여전히 Magento 1.9.2로 시도했지만 작동하지 않습니다
— Altaf Hussain

4

2

@ heaven7 나는 전체적으로 OnepageController.php 에서이 비트를 변경했지만 이것을 조작하는 것 이상을 수행했지만 내 코드를 나열하여 정확히 변경된 것을 볼 수 있습니다. 이 작업은 코어 폴더가 아닌 로컬 복사본에서만 수행해야합니다.

    `protected $_sectionUpdateFunctions = array(
           /* 'payment-method'  => '_getPaymentMethodsHtml',
            'shipping-method' => '_getShippingMethodsHtml',*/
            'review'          => '_getReviewHtml',
        );    public function saveBillingAction()
        {
           if ($this->_expireAjax()){
            return;
        }
            if ($this->getRequest()->isPost()) {
                $data = $this->getRequest()->getPost('billing', array());
                $customerAddressId =  $this->getRequest()->getPost('billing_address_id', false);
                $result = $this->getOnepage()->saveBilling($data, $customerAddressId);

    //            if (!isset($result['error'])) {
    //                if ($this->getOnepage()->getQuote()->isVirtual()) {
                        $this->loadLayout('checkout_onepage_review');
                        $result['goto_section'] = 'review';
                        $result['update_section'] = array(
                            'name' => 'review',
                            'html' => $this->_getReviewHtml()
                        );
                    }
                    /*elseif (isset($data['use_for_shipping']) && $data['use_for_shipping'] == 1) {
                        $this->saveShippingMethodAction();
                        $this->loadLayout('checkout_onepage_review');
                        $result['goto_section'] = 'review';
                        $result['update_section'] = array(
                            'name' => 'review',
                            'html' => $this->_getReviewHtml()
                        );

                        $result['allow_sections'] = array('shipping','review');
                        $result['duplicateBillingInfo'] = 'true';
                    }*/
                   /* else {
                        //$result['goto_section'] = 'shipping';
                        //TODO There is an error with loading the layout of the Review tab.
                        $result['goto_section'] = 'review';
                    }*/
               // }

                $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));

            }     
     public function saveShippingAction()
    {

       if($this->_expireAjax()){
           return;
       }
        if ($this->getRequest()->isPost()) {
            $data = $this->getRequest()->getPost('shipping', array());
            $customerAddressId = $this->getRequest()->getPost('shipping_address_id', false);
            $result = $this->getOnepage()->saveShipping($data, $customerAddressId);

            if (!isset($result['error'])) {
                $this->saveShippingMethodAction();
                $this->loadLayout('checkout_onepage_review');
                $result['goto_section'] = 'review';
                $result['update_section'] = array(
                    'name' => 'review',
                    'html' => $this->_getReviewHtml()
                );
            }
            $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
        }
    }

public function saveShippingMethodAction()
    {
        if ($this->_expireAjax()) {
            return;
        }
        if ($this->getRequest()->isPost()) {
            $data = $this->getRequest()->getPost('shipping_method', '');
            $result = $this->getOnepage()->saveShippingMethod($data);
            /*
            $result will have erro data if shipping method is empty
            */
            if(!$result) {
                Mage::dispatchEvent('checkout_controller_onepage_save_shipping_method',
                        array('request'=>$this->getRequest(),
                            'quote'=>$this->getOnepage()->getQuote()));
                $this->getOnepage()->getQuote()->collectTotals();
                $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));

                $result['goto_section'] = 'review';
                $result['update_section'] = array(
                    'name' => 'review',
                    'html' => $this->_getReviewHtml()
                );
            }
            $this->getOnepage()->getQuote()->collectTotals()->save();
            $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
        }
    }

1

1
이 사이트 형식에 대한 링크 만 게시물의 품질이 좋지 않습니다. 답을 넓히십시오.
— philwinkle

응답에 감사하지만 1.7에 비해 1.6에 더 초점을 맞추고 1.7의 단계 코드와 같은 위치에 Abstract.php 파일에있는 것과 약간의 차이가 있습니다.
— Egregory
당사 사이트를 사용함과 동시에 당사의 쿠키 정책과 개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.