Make customer attribute unique
-
16-10-2019 - |
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
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.
- Go to Magento Admin Panel.
- Go to Customers -> Manage Attributes.
- create new attribute or edit existing one.
- Select Unique Value YES.
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange