Author Topic: Customer Registration  (Read 25717 times)

Offline tosalet

  • Newbie
  • *
  • Posts: 33
  • Karma: +0/-0
    • View Profile
Customer Registration
« on: October 20, 2012, 10:32:54 AM »
Many people object to revealing a telephone number when registering for an online account.  Unfortunately, it is a required field during the registration process.  How can I remove that requirement and leave it optional?

Many thanks.

Offline abantecart

  • Administrator
  • Hero Member
  • *****
  • Posts: 4363
  • Karma: +301/-10
    • View Profile
    • Ideal Open Source Ecommerce Solution
Re: Customer Registration
« Reply #1 on: October 20, 2012, 11:35:09 AM »
There is no in admin setting to manage this yet. In the future we will have ability to build custom forms.

What you can do now is to do following simple edits in the code:

1. Open file storefront/controller/pages/account/create.php

Locate line: 119
Code: [Select]
$this->data['form'][ 'telephone' ] = $form->getFieldHtml( array(
                                                                       'type' => 'input',
                                                               'name' => 'telephone',
                                                               'value' => $this->request->post['telephone'],
                                                               'required' => true ));
Change : 'required' => true to  'required' => false

2. Open file /storefront/model/account/customer.php

Locate line : 87
Code: [Select]
    if ((strlen(utf8_decode($data['telephone'])) < 3) || (strlen(utf8_decode($data['telephone'])) > 32)) {
      $error['telephone'] = $this->language->get('error_telephone');
    }
Comment or remove line:
Code: [Select]
//$error['telephone'] = $this->language->get('error_telephone');

Done

Please  rate your experience or leave your review
We need your help to build better free open source ecommerce platform for everyone. See how you can help

Offline tosalet

  • Newbie
  • *
  • Posts: 33
  • Karma: +0/-0
    • View Profile
Re: Customer Registration
« Reply #2 on: October 21, 2012, 02:15:37 AM »
Many thanks. Great product and great support!

Offline tosalet

  • Newbie
  • *
  • Posts: 33
  • Karma: +0/-0
    • View Profile
Re: Customer Registration
« Reply #3 on: October 26, 2012, 04:07:44 AM »
Following on from this, I need to do the same for the guest checkout form. I have removed the 'required' field for telephone in 'guest_step_1 'but cannot find the correct .tpl to remove the error message. Could you please give me the location. Thanks.

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2064
  • Karma: +326/-13
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: Customer Registration
« Reply #4 on: October 26, 2012, 04:30:34 AM »
storefront/view/default/template/pages/checkout/guest_step_1.tpl

storefront/controller/pages/checkout/guest_step_1.php line 527
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

Offline tosalet

  • Newbie
  • *
  • Posts: 33
  • Karma: +0/-0
    • View Profile
Re: Customer Registration
« Reply #5 on: October 26, 2012, 06:28:56 AM »
Many thanks

Offline yujindeviant

  • Newbie
  • *
  • Posts: 9
  • Karma: +3/-0
    • View Profile
Re: Customer Registration
« Reply #6 on: January 05, 2017, 12:07:19 AM »
I'm trying to make this mandatory. This is removing the requirement. I can't seem to find any of the lines above. Anyone able to assist?

Offline srajput

  • Newbie
  • *
  • Posts: 18
  • Karma: +2/-0
    • View Profile
Re: Customer Registration
« Reply #7 on: July 15, 2017, 12:40:38 AM »
Hi, I also need to make telephone number a required field in both Guest and Customer registration forms. How can i do that?

Thank you in advance for your support.

Offline llegrand

  • Hero Member
  • *****
  • Posts: 1811
  • Karma: +526/-7
    • View Profile
Re: Customer Registration
« Reply #8 on: July 16, 2017, 09:47:34 AM »
This extension in the MarketPlace should solve your issue easily.

http://marketplace.abantecart.com/telephone_option




Offline srajput

  • Newbie
  • *
  • Posts: 18
  • Karma: +2/-0
    • View Profile
Re: Customer Registration
« Reply #9 on: July 17, 2017, 08:27:17 PM »
I made the changes below, now the telephone field in both forms is showing asterisk to indicate it is a required field. But when i submit form with telephone field being empty, it is submitted, and doesn't show error that telephone is empty. What do i need to enable that? like it shows error "Email Address does not appear to be valid!" if email field is left empty.

Quote
1. Open file storefront/controller/pages/account/create.php

Locate line: 119
Code: [Select]
      $this->data['form'][ 'telephone' ] = $form->getFieldHtml( array(
                                                                       'type' => 'input',
                                                                     'name' => 'telephone',
                                                                     'value' => $this->request->post['telephone'],
                                                                     'required' => true ));
Change : 'required' => true to  'required' => false

2. Open file /storefront/model/account/customer.php

Locate line : 87
Code: [Select]
       if ((strlen(utf8_decode($data['telephone'])) < 3) || (strlen(utf8_decode($data['telephone'])) > 32)) {
            $error['telephone'] = $this->language->get('error_telephone');
       }
Comment or remove line:
Code: [Select]
//$error['telephone'] = $this->language->get('error_telephone');

and

Quote
storefront/view/default/template/pages/checkout/guest_step_1.tpl

storefront/controller/pages/checkout/guest_step_1.php line 527

Offline Sam_78

  • Sr. Member
  • ****
  • Posts: 278
  • Karma: +43/-1
    • View Profile
Re: Customer Registration
« Reply #10 on: July 18, 2017, 11:05:56 AM »
Hi srajput
Have you tried going into Design->Forms manager and goto phone number and make that field required..

Offline HADY

  • Sr. Member
  • ****
  • Posts: 328
  • Karma: +27/-5
    • View Profile
Re: Customer Registration
« Reply #11 on: February 05, 2020, 06:53:40 AM »
Hello!

I have the same issue and I would like to make the telephone number to be required. I changed the false to true but that's only showing the red star. How to make it active please?
Thank you In Advanced
Regards
HADY

Offline Basara

  • Administrator
  • Hero Member
  • *****
  • Posts: 5964
  • Karma: +284/-2
    • View Profile
Re: Customer Registration
« Reply #12 on: December 22, 2022, 05:18:54 AM »
Hello!

I have the same issue and I would like to make the telephone number to be required. I changed the false to true but that's only showing the red star. How to make it active please?

Hello.
Check this 3rd party extension https://marketplace.abantecart.com/telephone_option

 

Powered by SMFPacks Social Login Mod