I need to add the ZIP field on the sign-up page.
I enabled the setShowAddressFields
parameter in order to show address fields, then I overrode the file /template/persistent/register.phtml
to show only the ZIP field.
Of course, the address validation fails and so I googled for the solution, but I only found some indication to modify the DB and the Zend validation function. I don't want do that, because I need address fields required during the checkout process.
So, any idea to simply show and store the ZIP field?
Best Answer
Please create
local.xml
in your theme layout folder.Refer the code below in
local.xml
:or
In customer.xml (current theme layout), add the below code in
customer_account_create
node:so it look like
Clear the cache after added code.
Please find the
_basicCheck
function inMage_Customer_Model_Address_Abstract
, this validating the registration required fields, so you have to rewrite this function_basicCheck
.Please refer this link its for telephone field (customize for zipcode field), have a look on this. Hope this will helps