Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 1 of 2
Customizing Onepage Checkout - Remove login *SOLVED*
 
KeyboardCowboy
Member
 
Total Posts:  65
Joined:  2008-07-01
Berlin, Germany
 

How to remove login block from OnepageCheckout. Every customer checkout as guest.
This is working with Magento 1.1.6!

1.) Onepage.php

public function getSteps()
{
    $steps 
= array();

    if (!
$this->isCustomerLoggedIn()) {
        
//$steps['login'] = $this->getCheckout()->getStepData('login');
        
$steps['billing'= array("label"=>"Billing Information""allow"=>true);
    
}
        
    $stepCodes 
= array('shipping''shipping_method''payment''review');

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

public function getActiveStep()
{
    
return 'billing';
}

2.) opcheckout.js

Class Checkout
Function setMethod

setMethod: function(){
    
//if ($('login:guest') && $('login:guest').checked) {
        
this.method 'guest';
        var 
request = new Ajax.Request(
            
this.saveMethodUrl,
            
{method'post'onFailurethis.ajaxFailure.bind(this), parameters{method:'guest'}}
        
);
        
Element.hide('register-customer-password');
        
this.gotoSection('billing');
    
/*}
    else if($('login:register') && ($('login:register').checked || $('login:register').type == 'hidden')) {
        this.method = 'register';
        var request = new Ajax.Request(
            this.saveMethodUrl,
            {method: 'post', onFailure: this.ajaxFailure.bind(this), parameters: {method:'register'}}
        );
        Element.show('register-customer-password');
        this.gotoSection('billing');
    }
    else{
        alert(Translator.translate('Please choose to register or to checkout as a guest'));
        return false;
    }*/
},

3.) billing.phtml
Here you can remove/comment out the input-fields for passwords.

I hope this is helpful.

 
Magento Community Magento Community
Magento Community
Magento Community
 
ZXIdo
Jr. Member
 
Total Posts:  17
Joined:  2008-03-05
 

Thankyou! Bookmarked!

I haven’t tried it yet but this could be very useful for me.

 
Magento Community Magento Community
Magento Community
Magento Community
 
KeyboardCowboy
Member
 
Total Posts:  65
Joined:  2008-07-01
Berlin, Germany
 

thats not all…

paste this

<li id="opc-login" class="section allow " style="display:none;">
            <
div id="checkout-step-login" class="box a-item" style="display:none;">
                <
input type="hidden" name="checkout_method" id="login:guest" value="guest" checked="checked" />
                <
script type="text/javascript">
                    
Event.observe(window'load', function() {
                        checkout
.setMethod();
                    
});
                
</script>
            
</div>
        </
li>

in onepage.phtml behind

<ol id="checkoutSteps" class="one-page-checkout">

now your checkout works correct, your customers will checkout as guest

i think that you didnt need to remove the code from billing.phtml

 
Magento Community Magento Community
Magento Community
Magento Community
 
cgrooms
Jr. Member
 
Total Posts:  3
Joined:  2008-10-21
 

Much appreciated, KeyboardCowboy. For reference, I also did not touch billing.phtml and it worked just fine (using the additional step in the post directly above).

 
Magento Community Magento Community
Magento Community
Magento Community
 
marcfalk
Sr. Member
 
Total Posts:  87
Joined:  2008-11-22
 

When I add this piece to Onepage.phtml :

$steps['billing'= array("label"=>"Billing Information""allow"=>true);
I remove the language support for “Billing information”. How do I keep the language-support, and still skip the first (login)step?
 
Magento Community Magento Community
Magento Community
Magento Community
 
k9disc
Jr. Member
 
Avatar
Total Posts:  11
Joined:  2008-12-28
 

This didn’t work for me on 1.2.0.2 ( I think)…

All’s well, the fields are gone, I’m able to get through to checkout as a guest but when click on place order to finalize it, there is a dialogue box that says,"Sorry, guest checkout is not enabled. Please try again or contact store owner.”

I have enabled guest checkout in admin>system>config>default config>website and store .

Kind of frustrating…

Any help out there?

peace,
Ron

 
Magento Community Magento Community
Magento Community
Magento Community
 
marcfalk
Sr. Member
 
Total Posts:  87
Joined:  2008-11-22
 
marcfalk - 03 January 2009 04:54 AM

When I add this piece to Onepage.phtml :

$steps['billing'= array("label"=>"Billing Information""allow"=>true);
I remove the language support for “Billing information”. How do I keep the language-support, and still skip the first (login)step?

I found a solution for this myself. Just add the helper to the code… see below:

$steps['billing'= array("label"=>Mage::helper('checkout')->__('Billing Information'), "allow"=>true);
 
Magento Community Magento Community
Magento Community
Magento Community
 
matt5409
Jr. Member
 
Total Posts:  15
Joined:  2008-12-22
 

Hi there, I am running Magento ver 1.2.0.2 and when i follow these steps my checkout page just appears blank. Any help is appreciated! smile

Thanks

** EDIT: ignore post it was my own fault for not pasting code correctly. works fine in ver 1.2.0.2 thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
FrinkInk
Jr. Member
 
Total Posts:  7
Joined:  2008-11-04
 

Anyone know why this doesn’t work in Internet Explorer (7)?

 
Magento Community Magento Community
Magento Community
Magento Community
 
KeyboardCowboy
Member
 
Total Posts:  65
Joined:  2008-07-01
Berlin, Germany
 

@FrinkInk

i think you made something wrong.

this is working with IE6, 7, 8, FF, Opera, ... and i think, thats not a browser-problem.

what doesnt work? what can you see (or not)? please make a screenshot or something else… “it doesnt work” is not very helpfull…

 
Magento Community Magento Community
Magento Community
Magento Community
 
Vergerider
Jr. Member
 
Total Posts:  3
Joined:  2009-01-07
 

I have used the method you mention and it works great thanks .. but ..  when previously registered customers are logged in they cannot checkout ... is this correct ?

Checkout is NOT possible if logged in?

I bet your thinking “yeah thats the whole point!” ...

Its just I would like customers to checkout as a guest but if they are logged in the checkout still works ..

I am XHTML and CSS not a php guy ... its’ll a bit too much for me..

Any help much appreciated ..  I offer small undisclosed rewards. wink

Image Attachments
screen1.jpg
 
Magento Community Magento Community
Magento Community
Magento Community
 
thesleepless
Jr. Member
 
Total Posts:  4
Joined:  2008-09-22
 

FutureStudios:

public function getSteps()
{
    $steps 
= array();

    
$steps['billing'= array("label"=>"Billing Information""allow"=>true);
        
    
$stepCodes = array('shipping''shipping_method''payment''review');

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

should do the trick

 
Magento Community Magento Community
Magento Community
Magento Community
 
Vergerider
Jr. Member
 
Total Posts:  3
Joined:  2009-01-07
 

the sleepless has won !! thanks. works fine now .. not sure why I didnt use the simpler method suggested by pss7_ I’m sure I tried it but it gave me a problem somewhere along the line sorry I cant be more specific .. it was late.

To thesleepless.. may you find rest in a place of your choosing .. thanks.. wink

 
Magento Community Magento Community
Magento Community
Magento Community
 
KeyboardCowboy
Member
 
Total Posts:  65
Joined:  2008-07-01
Berlin, Germany
 

@pss7_:

your solution doesnt remove the login-step! your customers can login or go back to login-step and checkout as a registered customer.

my solution remove the login-step and its not possible to checkout as a registered customer.

 
Magento Community Magento Community
Magento Community
Magento Community
 
graphicagenda
Jr. Member
 
Total Posts:  8
Joined:  2008-08-21
 

I completed this step. However, when in Safari, when an item is entered into the cart, going to the checkout page results in an empty cart. Does this have anything to do with the modifications in the beginning of this thread?

 
Magento Community Magento Community
Magento Community
Magento Community
 
tragic_rich
Jr. Member
 
Avatar
Total Posts:  15
Joined:  2009-04-03
San Diego, CA
 

Thanks pss7_
This was exactly the solution I needed! I wanted to have users automatically checkout as guests on one of my websites, but not on the other (both share an admin). When I edited the core files it propagated across both sites, which was not what I needed. I tried your approach and it worked great!

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 2