While testing a site currently in development, noticed that when creating a customer on the frontend, the customer saves with "Associate to Website" set to Admin, which means new users cannot log back in after creating the account.

Have also noticed it is not preventing the registration of multiple users at the same email address.

The Created From input does show the correct store the customer was created from.

We cannot set "Share Customer Accounts" to Global, which would allow the customer to login, even though they are associated with a different website, as customers of one website are not to have access to the other.

Have confirmed the website_id, attribute_id is associated with adminhtml_customer in the customer_form_attribute table.

Upon logging $customer just after $customer->save(); in \app\code\core\Mage\Customer\controllers\AccountController.php I notice an absence of website_id, perhaps related to the issue.

[_data:protected] => Array
        [entity_id] => 129905
        [group_id] => 1
        [entity_type_id] => 1
        [firstname] => xxxx
        [middlename] => 
        [lastname] => xxxx
        [email] => xxxx@xx.com
        [password] => 
        [password_hash] => xxxxxxxxxx
        [password_confirmation] => 
        [mailchimp_update_observer_ran] => 1
        [store_id] => 2
        [parent_id] => 0
        [created_at] => 2017-03-27T23:18:29+00:00
        [updated_at] => 2017-03-27 18:18:29
        [created_in] => xxxxxxxxxxx
        [disable_auto_group_change] => 0
        [confirmation] => 
        [p21contactid] => xxxxx
        [p21customerid] => xxxxxx

Any ideas?

UPDATE 3/29: app\code\core\Mage\Customer\Model\Resource\Customer.php

$bind['website_id'] = (int)$customer->getWebsiteId();

website_id is being set to 0, even though I'm registering customer from website 2

If I hardcode a valid store id(just for testing) then I am prevented from creating a customer with an email which already exists, but customer is still assigned to Admin website

$bind['website_id'] = 2;


$customer = Mage::getModel('customer/customer')->setWebsiteId(Mage::app()->getStore()->getWebsiteId());

Always returns the correct website ID

Will continue to update throughout troubleshooting. Appreciate any suggestions in the mean time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.