I want to allow only unique user account names in the system, so I added a new field which is stored in the customer entity.
Now I'm searching for an ajax solution for the customer registration form, which checks the new field.
I'd prefer build in functionality of Magento.
Do you have suggestions?
Go to Solution.
I have a suggestion for you.
Account create controller: app/code/core/Mage/Customer/controllers/AccountController.php
public function createPostAction()
We use JSON to return result. Our JSON has two keys:
-‘status’ has two values : ERROR and SUCCESS
-‘message’ => associated with its status.
We will create an array to store ‘status’ and ‘message’, and then use jsonEncode() to convert array to JSON format.
You should read this tutorial about Ajax Newsletter. We can apply this "JSON" rule in your Ajax Customer.