Author Topic: Customer Registration  (Read 7320 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: 3938
  • Karma: +236/-9
    • 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

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: 1716
  • Karma: +228/-10
  • 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: 1322
  • Karma: +336/-2
    • 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

  • Full Member
  • ***
  • Posts: 115
  • Karma: +18/-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..

 

LoliPromDress.com Prom dresses 2018