Question

is it possible to make a customer attribute unique, preferably on a website basis bit if not then globally?

I cant see how to do this.

Similar to the email address

Was it helpful?

Solution

The customer attributes has no is_unique option which is available for product attributes. The uniqueness of email is verified programatically in \Mage_Customer_Model_Resource_Customer::_beforeSave. So you can just mimic it for your attribute.

OTHER TIPS

Try to do this from magento backend.

  1. Go to Magento Admin Panel.
  2. Go to Customers -> Manage Attributes.
  3. create new attribute or edit existing one.
  4. Select Unique Value YES.
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top