public function index()
    {
        // If we are using simple checkout, skip
        if (Checkout::config()->simple_checkout) {
            return $this->redirect($this->Link('finish'));
        }
        
        // If we have turned off login, or member logged in
        if (!(Checkout::config()->login_form) || Member::currentUserID()) {
            return $this->redirect($this->Link('billing'));
        }

        $this->customise(array(
            'Title'     => _t('Checkout.SignIn', "Sign in"),
            "Login"     => true,
            'LoginForm' => $this->LoginForm()
        ));

        $this->extend("onBeforeIndex");

        return $this->renderWith(array(
            'Checkout',
            'Page'
        ));
    }
public function index()
    {
        // If we are using simple checkout, skip
        if (Checkout::config()->simple_checkout) {
            return $this->redirect($this->Link('finish'));
        }
        
        // If we have turned off login, or member logged in
        if (!(Checkout::config()->login_form) || Member::currentUserID()) {
            return $this->redirect($this->Link('billing'));
        }

        $this->customise(array(
            'Title'     => _t('Checkout.SignIn', "Sign in"),
            "Login"     => true,
            'LoginForm' => $this->LoginForm()
        ));

        $this->extend("onBeforeIndex");

        return $this->renderWith(array(
            'Checkout',
            'Page'
        ));
    }
public function index ( ) { // If we are using simple checkout, skip if ( Checkout :: config ( ) -> simple_checkout ) { return $ this -> redirect ( $ this -> Link ( 'finish' ) ) ; } // If we have turned off login, or member logged in if ( ! ( Checkout :: config ( ) -> login_form ) || Member :: currentUserID ( ) ) { return $ this -> redirect ( $ this -> Link ( 'billing' ) ) ; } $ this -> customise ( array ( 'Title' => _t ( 'Checkout.SignIn' , "Sign in" ) , "Login" => true , 'LoginForm' => $ this -> LoginForm ( ) ) ) ; $ this -> extend ( "onBeforeIndex" ) ; return $ this -> renderWith ( array ( 'Checkout' , 'Page' ) ) ; }
If user logged in, redirect to billing info, else show login, register
or "checkout as guest" options.
If user logged in redirect to billing info else show login register or checkout as guest options .