Magento: Custom checkout page

checkoutmagentomagento-1.7

I am messing around with Magento 1.7.2, but I am unable to figure it out. I have created an online store that sell custom products (Virtual Products).

There is no use for allowing the users to register on my store as they can buy the products only once. So I need to disable the registration.

There are 4 steps on the checkout page by default which the customer needs to complete before ordering.

  1. Checkout Method
  2. Billing Information
  3. Payment Information
  4. Order Review

So what I need is to eliminate step 1 as I use only guest checkout and there is no point in providing login or registration option. So after the customer clicks on checkout, they need to get to step 2 directly.

In Step 2 i.e. Billing information I need only the customer Name(First and Last name) and the email and everything needs to be removed like the telephone number, address etc.,

In Step 3 I provide only PayPal and it will be good if I can eliminate that step.

Step 4, no problem with it.

So can anyone tell me how I can alter the checkout page or is it possible to create a new custom checkout page that meets my requirements. It would be helpful if anyone can point to some good resources or tutorials.

Appreciate any kind of help.

Best Answer

If you want to remove one step from the checkout process, you need to locate this variable:

$stepCodes = array('billing', 'shipping', 'shipping_method', 'payment', 'review');

So if you want to remove the billing process (for example), then your code should looks like this:

$stepCodes = array('shipping', 'shipping_method', 'payment', 'review');

The best way to do this is making a custom module, extend the Mage_Checkout_Block_Onepage class in this way:

class Vendor_ModuleName_Block_Onepage extends Mage_Checkout_Block_Onepage
{
    public function getSteps()
    {
        $steps = array();

        if (!$this->isCustomerLoggedIn()) {
            $steps['login'] = $this->getCheckout()->getStepData('login');
        }

        $stepCodes = array('shipping', 'shipping_method', 'payment', 'ddate', 'review');

        foreach ($stepCodes as $step) {
            $steps[$step] = $this->getCheckout()->getStepData($step);
        }
        return $steps;
    }
}

And save this on local folder with this structure:

local/vendor/module_name/Block/Onepage.php

I hope this helps.

Related Topic