Magento – Adding new customer from backend not inserting store id

admincustomer

I am using magento 1.7.0.2.
I am having issue regarding store id.
When I add new customer from front end by sign up it adds store id in "Customer Entity" table.
But When I try to add customer from backend manually it doesn't insserts 'store id' in "Customer Entity" table.It inserss '0' when adding with admin.

Best Answer

It is simple. go to /app/code/core/Mage/Adminhtml/controllers/CustomerController.php and just before //send welcome email part

// Mage::dispatchEvent('adminhtml_customer_prepare_save', array(
//                    'customer'  => $customer,
//                    'request'   => $this->getRequest()
//                ));

And put following code there.

$storeId = $customer->getSendemailStoreId();
Mage::app()->setCurrentStore($storeId);
$customer->save(); 

That's it now you can choose store from backend and will also be inserted in to customer_entity table.

solution find from phprocks

Related Topic