I will explain step by step.

1.I selected checkout method as register.

2.So in billing information i get extra two fields password and confirm password. and I have added extra customer type field.based on selection of customer type the tax should calculate in order review tab.

so normally the entire check out steps will temporarely store in quote object.But I want to store customer register information(in billing tab) permanently .because it should reflect in order review tab in order to tax sholud calculate based on customer type. for that i created one observer

3.If i click continue button one event will trigger .it will save customer information in db permanently.

4.using above customer register information to login I placed following code below save functionality.

but its not working.I mean If i click continue button in billing tab it saving the data in db.but not login.

class Exinent_Billingtax_Model_Observer {
    public function autoRegisterBilling($evt){
            $data = $evt->getEvent()->getControllerAction()->getRequest()->getPost('billing', array());
            //echo "<pre>";
            $customer = Mage::getModel("customer/customer");
            $email = $data['email'];
            $websiteId = Mage::app()->getWebsite()->getId();
            $store = Mage::app()->getStore();
            $pwd = $data['customer_password'];

            if (!$customer->getId()) {
                 //Code begins here for new customer registration
                $customer->website_id = $websiteId;
                $customer->firstname = $data['firstname'];
                $customer->lastname = $data['lastname'];

            Mage::getSingleton('customer/session')->loginById($customer->getId()); // to login that customer.
            $userSession = Mage::getSingleton('customer/session');
            Mage::dispatchEvent('customer_login', array('customer'=>$customer));


1 Answer 1


Perhaps try

$session = Mage::getSingleton("customer/session");

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.