Shopping Cart Operations > Template Support

Customer Registration

(1/3) > >>

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

--- Code: --- $this->data['form'][ 'telephone' ] = $form->getFieldHtml( array(
                                                                       'type' => 'input',
                                                               'name' => 'telephone',
                                                               'value' => $this->request->post['telephone'],
                                                               'required' => true ));

--- End code ---
Change : 'required' => true to  'required' => false

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

Locate line : 87

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

--- End code ---
Comment or remove line:

--- Code: ---//$error['telephone'] = $this->language->get('error_telephone');

--- End code ---

Done

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

Navigation

[0] Message Index

[#] Next page

Go to full version
Powered by SMFPacks Social Login Mod