News:

AbanteCart v1.4.2 is released.

Main Menu

Customer Registration

Started by tosalet, October 20, 2012, 10:32:54 AM

Previous topic - Next topic

tosalet

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.

abantecart

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
$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
    if ((strlen(utf8_decode($data['telephone'])) < 3) || (strlen(utf8_decode($data['telephone'])) > 32)) {
      $error['telephone'] = $this->language->get('error_telephone');
    }

Comment or remove line:

//$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

tosalet

Many thanks. Great product and great support!

tosalet

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.

abolabo

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

tosalet


yujindeviant

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?

srajput

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.

llegrand

This extension in the MarketPlace should solve your issue easily.

http://marketplace.abantecart.com/telephone_option




srajput

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.

Quote1. 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

Quotestorefront/view/default/template/pages/checkout/guest_step_1.tpl

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

Sam_78

Hi srajput
Have you tried going into Design->Forms manager and goto phone number and make that field required..

HADY

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

Basara

Quote from: HADY 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?

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

Forum Rules Code of conduct
AbanteCart.com 2010 -