Как удалить шаги из оформления заказа Magento на странице?


Я использую CE 1.7 и в настоящее время пытаюсь удалить доставку, способ доставки и этапы оплаты из оформления заказа на странице. Я уже удалил шаги из local\mage\checkout\block\onepage\abstract.php. Моя проблема возникает при попытке перейти от платежной информации к просмотру, когда я нажимаю "Продолжить", загружается изображение следующего шага загрузки, а не остается неподвижным. Любые идеи будут высоко оценены.

Author: Marius, 2013-08-26

4 answers

Попробуйте переписать ниже файлы блоков со следующими функциями:

Класс перезаписи 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;
    }

Я надеюсь, что теперь проблема, связанная с прогрессом, не возникнет.

 13
Author: Bijal Bhavsar, 2014-12-23 15:18:02

@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));
        }
    }
 2
Author: Egregory, 2013-12-20 16:24:14

Пожалуйста, перейдите по этой ссылке

Http://sapnandu-magento.blogspot.in/2012/04/magento-onestep-checkout-remove.html

Или

Http://knowledgevalley.blogspot.in/2012/01/magento-skip-shipping-method-from.html

Это может помочь вам

 1
Author: Keyur Shah, 2013-08-27 04:04:40