Post by vreyesim » Thu Mar 06, 2025 10:00 am

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 ?

New member

Posts

Joined
Sun Jan 28, 2018 2:34 am

User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by vreyesim » Thu Mar 06, 2025 12:23 pm

thank you :)

New member

Posts

Joined
Sun Jan 28, 2018 2:34 am

Post by paulfeakins » Thu Mar 06, 2025 8:43 pm

vreyesim wrote:
Thu Mar 06, 2025 12:23 pm
thank you :)
Can we consider this issue [SOLVED]?

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by vreyesim » Thu Mar 06, 2025 10:12 pm

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.

New member

Posts

Joined
Sun Jan 28, 2018 2:34 am

Post by ADD Creative » Thu Mar 06, 2025 11:59 pm

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.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by vreyesim » Sat Mar 08, 2025 6:16 am

we can close now, it is a theme problem, different register.php has written for one page checkout.

New member

Posts

Joined
Sun Jan 28, 2018 2:34 am
Who is online

Users browsing this forum: No registered users and 22 guests