AbanteCart Community

eCommerce construction => Installation and Configuration => Topic started by: HADY on February 25, 2020, 02:41:13 AM

Title: Create Account AbanteCart v1.2.15
Post by: HADY on February 25, 2020, 02:41:13 AM
Hello!
I need your help to add some required fields in Creating account for new clients please. Any documentation about this please?? I will appreciate your support because this is very important. The problem is some fields is optional and I would like to change it to required.

NOTE: I use AbanteCart v1.2.15


God Blessing you...
Title: Re: Create Account AbanteCart v1.2.15
Post by: Sam_78 on February 25, 2020, 12:15:15 PM
Hi you can set values here
https://github.com/abantecart/abantecart-src/blob/master/public_html/storefront/controller/pages/account/create.php#L207

change 'required' => false to true if you want it required
Title: Re: Create Account AbanteCart v1.2.15
Post by: HADY on February 26, 2020, 03:11:55 AM
Hi you can set values here
https://github.com/abantecart/abantecart-src/blob/master/public_html/storefront/controller/pages/account/create.php#L207

change 'required' => false to true if you want it required

Thanks for replying, I tried that since a time and modified that file but that's only mark the field as required but hasn't a power in the registration form, still people can register without including the Telephone and Company Name in the registration form. Am sure there is something else I have to modify to take act in the form . any ideas Guys ?? 
Thanks again...
Title: Re: Create Account AbanteCart v1.2.15
Post by: Basara on February 26, 2020, 03:19:35 AM
Hi.
Try to add validation to the model file https://github.com/abantecart/abantecart-src/blob/master/public_html/storefront/model/account/customer.php#L629
Title: Re: Create Account AbanteCart v1.2.15
Post by: HADY on February 26, 2020, 04:51:07 AM
Hi.
Try to add validation to the model file https://github.com/abantecart/abantecart-src/blob/master/public_html/storefront/model/account/customer.php#L629


Thanks for replying, I did that too. here is the content of this file in the attachment:




Is there anything wrong please?

Thanks for being helpful here...
Title: Re: Create Account AbanteCart v1.2.15
Post by: HADY on February 26, 2020, 07:14:42 AM
Hi community!

I fixed the issue of telephone to make it required. I still have the issue with company name doesn't worked yet. if someone need the details I can share details.
Title: Re: Create Account AbanteCart v1.2.15
Post by: Basara on February 26, 2020, 08:14:09 AM
Yes, please share  ;)
Title: Re: Create Account AbanteCart v1.2.15
Post by: HADY on February 26, 2020, 08:33:05 AM
Changing next link:
https://github.com/abantecart/abantecart-src/blob/master/public_html/storefront/model/account/customer.php#L681

TO

        if (!$data['telephone'] && (mb_strlen($data['telephone']) < 3 || mb_strlen($data['telephone']) > 32)) {