Post by avsrthe » Thu May 25, 2023 1:08 pm

@SohBH Thank you posting your code again. But that email validation with my own posted code already worked. I was asking for firstname and address field together if found in blacklist in a particular ID then block. I made it to work after searching for different syntax and arrived at a solution. Though I am not an expert, somehow I did it.
AVSRThe
Last edited by avsrthe on Wed May 31, 2023 11:34 pm, edited 1 time in total.

New member

Posts

Joined
Tue Jan 05, 2021 10:04 am

Post by avsrthe » Thu May 25, 2023 1:10 pm

softmonke wrote:
Tue May 23, 2023 4:53 am
You can try adding the following to your "index.php" file and it should show you the errors when you access the page/submit the form:

Code: Select all

error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
Thank you. Already it was set. But I had difficulty in fixing it with my moderate knowledge. Now I fixed and everything works.

New member

Posts

Joined
Tue Jan 05, 2021 10:04 am

Post by SohBH » Thu May 25, 2023 7:22 pm

catalog/model/account/customer.php

Code: Select all

public function getBlacklistCustomer(): array {
	$query = $this->db->query("SELECT * FROM `blacklist`");
	return $query->row;
}

catalog/controller/account/register.php
Does not contain address

Code: Select all

$blacklisted = $this->model_account_customer->getBlacklistCustomer();

	if (in_array(strtolower($this->request->post['firstname']), $blacklisted['firstname']) || (utf8_strlen(trim($this->request->post['firstname'])) < 1) || (utf8_strlen(trim($this->request->post['firstname'])) > 32)) {
		$this->error['firstname'] = $this->language->get('error_firstname');
	}

	if (in_array(strtolower($this->request->post['email']), $blacklisted['email']) || (utf8_strlen($this->request->post['email']) > 96) || !filter_var($this->request->post['email'], FILTER_VALIDATE_EMAIL)) {
		$this->error['email'] = $this->language->get('error_email');
	}

	if (in_array((int)$this->request->post['telephone'], $blacklisted['telephone']) || (utf8_strlen($this->request->post['telephone']) < 3) || (utf8_strlen($this->request->post['telephone']) > 32)) {
		$this->error['telephone'] = $this->language->get('error_telephone');
	}

Business Web Development | Content Creation | Analytics and Reporting | SEO


User avatar
Active Member

Posts

Joined
Mon Nov 02, 2020 12:01 am
Location - Malaysia

Post by avsrthe » Wed May 31, 2023 7:16 pm

@SohBH
Thanks for your answer.
Address I meant for adding validation to checkout in guest.php.
I have summarized everything and arrived at modified codes that suits my requirement and done it.

New member

Posts

Joined
Tue Jan 05, 2021 10:04 am

Post by khnaz35 » Wed May 31, 2023 10:20 pm

If it resolve your issue kindly ADD word [SOLVED] in the post title

Urgent Questions shoot here: khnaz35@gmail.com
Enjoy nature ;) :) :-*


User avatar
Active Member

Posts

Joined
Mon Aug 27, 2018 11:30 pm
Location - Malaysia
Who is online

Users browsing this forum: No registered users and 417 guests