Farhan Islam
Farhan Islam

Reputation: 27

Change Magento Customer Account Create in data to website

I am trying to find a way to update the accounts already created in admin panel.

During the create process, the account was created mistakenly in Admin section (caused user to not login via frontend).

See Screenshot: http://puu.sh/9Rjvp/6f4fffd1c6.jpg or https://i.sstatic.net/0Q2vm.jpg

I am looking for a programmatic approach using which I can update the account created in value to "website" after-which the customer can be able to login to site. (this can be database direct update if its best suite)

Reason behind for looking a programmatic solution is clear for following reasons.

  1. The number of effected accounts are about 500+
  2. Each or many of these accounts have orders belonging to their account (therefore re-create is not a good approach).

Let me know what database values I have to change for this fix or what should I need to instruct to my custom module?

Any help is highly appreciated.

Upvotes: 0

Views: 1068

Answers (1)

Krishna Sunuwar
Krishna Sunuwar

Reputation: 2947

Following is customer update code snippet:

$customer = Mage::getModel('customer/customer')->load(1212);
$customer->setWebsiteId(2)
$customer->save();

The above code will update website to 2 for customer 1212.

God luck!

Upvotes: 1

Related Questions