hello,
opencart 2,3,0,2
we are dispatching our products with our vehicles to customers address only one city. telephone number is very important. it must be 10 digits without any label, character. since drivers distribution line is determined in the morning with customers telephone numbers.
catalog/controller/account/register.php
i have solved checking telephone number 10 digit and only numeric with the code below.
if ((utf8_strlen($this->request->post['telephone']) < 9) || (utf8_strlen($this->request->post['telephone']) > 11) || preg_match('/[^\d]/is', $this->request->post['telephone'])){
$this->error['telephone'] = $this->language->get('error_telephone');
but catalog/controller/checkout/register.php is not solved in this way.
some forums say that telephone can be changed in settings which there is not any option in 2,3,0,2.
last name is perfect works with the code below catalog/controller/checkout/register.php
if ((utf8_strlen(trim($this->request->post['lastname'])) < 1) || (utf8_strlen(trim($this->request->post['lastname'])) > 32)) {
$json['error']['lastname'] = $this->language->get('error_lastname');
}
changed its variable with telephone but does not work.
what do i miss ? What is wrong ?
opencart 2,3,0,2
we are dispatching our products with our vehicles to customers address only one city. telephone number is very important. it must be 10 digits without any label, character. since drivers distribution line is determined in the morning with customers telephone numbers.
catalog/controller/account/register.php
i have solved checking telephone number 10 digit and only numeric with the code below.
if ((utf8_strlen($this->request->post['telephone']) < 9) || (utf8_strlen($this->request->post['telephone']) > 11) || preg_match('/[^\d]/is', $this->request->post['telephone'])){
$this->error['telephone'] = $this->language->get('error_telephone');
but catalog/controller/checkout/register.php is not solved in this way.
some forums say that telephone can be changed in settings which there is not any option in 2,3,0,2.
last name is perfect works with the code below catalog/controller/checkout/register.php
if ((utf8_strlen(trim($this->request->post['lastname'])) < 1) || (utf8_strlen(trim($this->request->post['lastname'])) > 32)) {
$json['error']['lastname'] = $this->language->get('error_lastname');
}
changed its variable with telephone but does not work.
what do i miss ? What is wrong ?
You can set a regex validation for the telephone number.
https://stackoverflow.com/questions/166 ... one-number
Note: You do not need to have less than 9 or more than 11 you can have equals 10.
More information about form validation can be found
https://webkul.com/blog/validation-of-t ... -opencart/
https://code.tutsplus.com/form-input-va ... cms-33095t
https://stackoverflow.com/questions/196 ... th-pattern
https://stackoverflow.com/questions/329 ... one-number
https://stackoverflow.com/questions/748 ... html-input
https://stackoverflow.com/questions/633 ... ne-numbers
viewtopic.php?t=2826
viewtopic.php?t=9557
https://stackoverflow.com/questions/132 ... n-opencart
viewtopic.php?t=49109
https://www.google.com/search?q=how+to+ ... r+opencart
https://stackoverflow.com/questions/166 ... one-number
Note: You do not need to have less than 9 or more than 11 you can have equals 10.
More information about form validation can be found
https://webkul.com/blog/validation-of-t ... -opencart/
https://code.tutsplus.com/form-input-va ... cms-33095t
https://stackoverflow.com/questions/196 ... th-pattern
https://stackoverflow.com/questions/329 ... one-number
https://stackoverflow.com/questions/748 ... html-input
https://stackoverflow.com/questions/633 ... ne-numbers
viewtopic.php?t=2826
viewtopic.php?t=9557
https://stackoverflow.com/questions/132 ... n-opencart
viewtopic.php?t=49109
https://www.google.com/search?q=how+to+ ... r+opencart
DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.
https://www.youtube.com/watch?v=zXIxDoCRc84
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
unfortunately not,
i have checked the links, there are some solutions which propose solutions. i am not pro, and i do not want to change most of the core. all i am curiuos is the reason of similar codes are not work in account/register and checkout/register? if i can see the difference, try to make an easy change.
What i have
-in account/register has isset function, checkout/register not.
-javas is not the solution point.
-preg_match('/[^\d]/is', $this->request->post['telephone'])) works well for me, no need to change
-no need to change tpl files, theme does not effect
- tpl files have <div class="form-group required"> in telephone, but moves not required
-i can not make work error line, telephone validation
i am many more mixed up.
can i do something like email check
finally what i should write to checkout/register without spoiling of the core.
i have checked the links, there are some solutions which propose solutions. i am not pro, and i do not want to change most of the core. all i am curiuos is the reason of similar codes are not work in account/register and checkout/register? if i can see the difference, try to make an easy change.
What i have
-in account/register has isset function, checkout/register not.
-javas is not the solution point.
-preg_match('/[^\d]/is', $this->request->post['telephone'])) works well for me, no need to change
-no need to change tpl files, theme does not effect
- tpl files have <div class="form-group required"> in telephone, but moves not required
-i can not make work error line, telephone validation
i am many more mixed up.
can i do something like email check
finally what i should write to checkout/register without spoiling of the core.
The change should work the same in both files. Maybe there was a error in the change you made, an extension is modifying your checkout or you were testing the quest checkout.
Who is online
Users browsing this forum: No registered users and 22 guests