0

i need to create a custom form for the registration customer.

i have used the file

/app/design/frontend/default/{theme}/template/customer/formregister.phtml 

I entered:

<input  type="text" class="input-text " name="company" value="<?php echo $this->escapeHtml($this->getAddress()->getCompany()) ?>" title="<?php echo $this->__('Company') ?>"  />

and

<input type="text" class="input-text " id="billing:vat_id" name="vat_id" value="<?php echo $this->escapeHtml($this->getAddress()->getVatId()) ?>" title="<?php echo $this->__('VAT Number') ?>" class="input-text " />

but the value is not recorded.

Why?

  • What you mean by not recorded? Magento will not automatically save the fields you are adding to the forms. You need to make necessary changes like overriding controller action or adding customer attributes etc. – Nidheesh Oct 10 '16 at 8:57
  • I have not to add new fields. I inserted the old fields: vat_id, company in form page "create account" – Alessandro Gnola Oct 10 '16 at 9:02
  • oops! didn't check the field names. – Nidheesh Oct 10 '16 at 9:12
  • The values for vat_id and company are not recording, correct? – Nidheesh Oct 10 '16 at 9:14
0

By Default, magento has the functioanlity to save the fields like company and vat_id. You don't need add them to the form, if you copied it from unmodified base template.

Go to System >> Configuration >> Customer configuration >> Create new account options and then update Show VAT Number on Frontend to Yes.

Don't forget to choose the appropriate website scope if you are on a multistore.

Flush magento cache once done.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.