Question: I Need To Make Customer Phone Unique

I Need To Make Customer Phone Unique

Hi, Please help me to get an appropriate file for editing to make a phone no. is unique, means it will not possible to add customer twice by his phone no. Thank you

AM

Ahmed Hamdy Montaser

Asked
Hi,

Please help me to get an appropriate file for editing to make a phone no. is unique, means it will not possible to add customer twice by his phone no.

Thank you
  • MS

    Mian Saleem

    Answered
    Hello,

    You can `add` method of customer controller `app/controllers/admin/Customers.php` add new rule for unique phone as there is one for email.

    Thank you
  • AM

    Ahmed Hamdy Montaser

    Answered
    Please kindly let me know in which line I have to make modification and the line code for that cause I tried by some errors.

    Thanks in advance.
  • MS

    Mian Saleem

    Answered
    Hello,

    > Please be informed that we don't offer support for modifications or modified versions. You are allowed to do it at your own risk as per license.

    You can see the line

    ```
    $this->form_validation->set_rules('email', lang('email_address'), 'is_unique[companies.email]');
    ```

    You can add new line after this as following

    ```
    $this->form_validation->set_rules('phone', lang('phone'), 'is_unique[companies.phone]');
    ```

    Thank you
  • AM

    Ahmed Hamdy Montaser

    Answered
    Thank you
  • Login to Reply