I've read a number of other questions related to removing steps, and even one about removing the billing step, but all I do is end up with errors. I want to simply remove the Billing Information step altogether.
This is what I've done so far:
app/code/etc/Sneakypixel_Checkout.xml:
<?xml version="1.0"?> <config> <modules> <Sneakypixel_Checkout> <active>true</active> <codePool>local</codePool> <depends>Mage_Checkout</depends> </Sneakypixel_Checkout> </modules> </config> app/code/local/Sneakypixel/Checkout/etc/config.xml:
<config> <global> <blocks> <checkout> <rewrite> <onepage_abstract>Sneakypixel_Checkout_Block_Onepage_Abstract</onepage_abstract> </rewrite> </checkout> </blocks> </global> </config> app/code/local/Sneakypixel/Checkout/controllers/OnepageController.php: Commented out
$result['allow_sections'] = array('shipping'); $result['duplicateBillingInfo'] = 'true'; from
<?php require_once Mage::getModuleDir('controllers', "Mage_Checkout").DS."OnepageController.php"; class Sneakypixel_Checkout_OnepageController extends Mage_Checkout_OnepageController /** * Save checkout billing address */ 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); if (isset($data['email'])) { $data['email'] = trim($data['email']); } $result = $this->getOnepage()->saveBilling($data, $customerAddressId); if (!isset($result['error'])) { if ($this->getOnepage()->getQuote()->isVirtual()) { $result['goto_section'] = 'payment'; $result['update_section'] = array( 'name' => 'payment-method', 'html' => $this->_getPaymentMethodsHtml() ); } elseif (isset($data['use_for_shipping']) && $data['use_for_shipping'] == 1) { $result['goto_section'] = 'shipping_method'; $result['update_section'] = array( 'name' => 'shipping-method', 'html' => $this->_getShippingMethodsHtml() ); // $result['allow_sections'] = array('shipping'); // $result['duplicateBillingInfo'] = 'true'; } else { $result['goto_section'] = 'shipping'; } } $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result)); } } app/code/local/Sneakypixel/Checkout/Block/Onepage.php:
<?php class Sneakypixel_Checkout_Block_Onepage extends Mage_Checkout_Block_Onepage { /** * Get 'one step checkout' step data * * @return array */ public function getSteps() { $steps = array(); $stepCodes = $this->_getStepCodes(); if ($this->isCustomerLoggedIn()) { $stepCodes = array_diff($stepCodes, array('login')); } foreach ($stepCodes as $step) { $steps[$step] = $this->getCheckout()->getStepData($step); } return $steps; } /** * Get active step * * @return string */ public function getActiveStep() { return $this->isCustomerLoggedIn() ? 'billing' : 'login'; } } app/code/local/Sneakypixel/Checkout/Block/Onepage/Abstract.php:
<?php class Sneakypixel_Checkout_Block_Onepage_Abstract extends Mage_Checkout_Block_Onepage_Abstract { protected function _getStepCodes() { return array('login', 'payment', 'review'); } } All I get are errors. I feel as though I'm missing something in my config.xml, or that I've touched too many files. This is my first time dipping into the waters of overwriting core blocks and controllers via custom modules.