Jump to content
thirty bees forum

Question

Posted (edited)

In the file /controllers/front/AddressController.php in the function processSubmitAddress() I added a check that the customer has added a house number. This is done by adding the following check:

if(!preg_match('/[0-9]/', $address->address1) && !preg_match('/[0-9]/', $address->address2))
	$this->errors["extra"] = "<b>Address</b> doesn't contain a number!";

This works most of the time. However, when the customer chooses to register as guest this function is not called the first time he enters his address. (when he changes it it is called).

I am looking for where the address is handled in that case so that I can have some check there too.

Edited by musicmaster

1 answer to this question

Recommended Posts

  • 0
Posted

When I check in the browser console I see two commands going to the server. 

The first - to index.php?controller=authentication?rand=1639850796291 - sends the name and address. It gets a rather basic confirmation back (with error status data and the new customer and address id's). Obviously something is going wrong here.

The second - to index.php?controller=order-opc?rand=1639850802642 - sends method="updateAddressesSelected" with the address ids and gets back a lot of data for a variety of hooks.

hook.jpg.854547293c24d6223bab668d9bb7ba3b.jpg

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...