18

I'm using CE 1.7 and I am currently trying to remove the shipping, shipping method, and payment steps from Onepage checkout. I already removed the steps from local\mage\checkout\block\onepage\abstract.php. My issue comes when trying to progress from billing information to review when i click continue it loads the loading next step image than sits still. Any ideas would be much appreciated.

  • Since i cannot comment (yet), please could you tell us and answer your question, what you did (in OnepageController.php), to skip payment in CE 1.7. Thanks. – heaven7 Dec 2 '13 at 21:03
  • Hi @Egregory, any more info on how you did this? I'm trying to do the same! – Edgar Quintero Feb 3 '16 at 16:24
  • @edgarQuintero the code I used is a combination of the approved answer and the code I submitted. It also might be different in newer versions as I was doing this in CE 1.7 – Egregory Feb 4 '16 at 17:09
  • @Egregory Yea I rewrote the below functions posted by Bijal Bhavsar and also added your OnepageController.php modifications, cleared cache and session just to be sure, but still no change. I'm also on 1.7. – Edgar Quintero Feb 8 '16 at 21:18
13

Try to rewrite below block files with following functions:

Rewrite class Mage_Checkout_Block_Onepage_Billing

    public function canShip()
    {
        return false;
    }

Rewrite class Mage_Checkout_Block_Onepage_Shipping_Method

    public function isShow()
    {
        return false;
    }

Rewrite class Mage_Checkout_Block_Onepage_Shipping

    public function isShow()
    {
          return false;
    }

I hope now issue related to progress will not occurs.

  • I'm still learning Magento's rewrite capabilities. Would i create this in a new module or do I just create this in the app\code\local section? – Egregory Aug 27 '13 at 15:40
  • You have to create new module and rewrite files. How to override block file? You can review inchoo.net/ecommerce/magento/… – Bijal Bhavsar Sep 3 '13 at 9:25
  • Thanks i got everything figured out, the onepagecontroller.php was hanging me up once i made the correct changes and did a rewrite for that everything started working. – Egregory Sep 11 '13 at 15:37
  • @Egregory could you please share yours onepagecontroller.php - how did you change it to started working. Thanks! – srdan Feb 28 '15 at 6:32
  • It is old, but still i tried with Magento 1.9.2 and it is not working – Altaf Hussain Oct 5 '15 at 10:56
2

@heaven7 I changed these bits in the OnepageController.php overall i did more than manipulate this but i will list my code so you can see what I changed exactly. Just remember to do this in only a local copy and not in the core folder.

    `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

please follow this link

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

or

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

it may help you

  • 1
    Link only posts are of poor quality for this site's format. Please expand your answer. – philwinkle Aug 27 '13 at 4:57
  • i appreciate the response but these focus more on ce 1.6 than 1.7 there are some differences in where things are located like the step codes in 1.7 are located in the Abstract.php file. – Egregory Aug 27 '13 at 20:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.