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.

Marius
199k55 gold badges431 silver badges837 bronze badges
asked Aug 26, 2013 at 23:02
4
  • 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. Commented Dec 2, 2013 at 21:03
  • Hi @Egregory, any more info on how you did this? I'm trying to do the same! Commented Feb 3, 2016 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 Commented Feb 4, 2016 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. Commented Feb 8, 2016 at 21:18

4 Answers 4

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.

Bartosz Górski
4772 gold badges5 silver badges18 bronze badges
answered Aug 27, 2013 at 7:28
8
  • 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? Commented Aug 27, 2013 at 15:40
  • You have to create new module and rewrite files. How to override block file? You can review inchoo.net/ecommerce/magento/… Commented Sep 3, 2013 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. Commented Sep 11, 2013 at 15:37
  • @Egregory could you please share yours onepagecontroller.php - how did you change it to started working. Thanks! Commented Feb 28, 2015 at 6:32
  • It is old, but still i tried with Magento 1.9.2 and it is not working Commented Oct 5, 2015 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));
 }
 }
answered Dec 20, 2013 at 16:14
1
2
  • 1
    Link only posts are of poor quality for this site's format. Please expand your answer. Commented Aug 27, 2013 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. Commented Aug 27, 2013 at 20:32

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.