1

I need to add a file upload field on the registration form to allow users to upload documents on their profile, how can I do that? Thanks.

1
  • you can make customer attribute for upload documents
    – ND17
    Jul 17, 2015 at 7:29

1 Answer 1

1

Go to http://www.silksoftware.com/magento-module-creator/#.VG-SJ_nF9Zo and using its Module Creator to create a new module called "YourCustomerAttribute".

Set "Add Customer Attribute" to YES Make proper inputs and selections as you needed. Make sure to select the forms you needed the new attributes to be used. Generate the module. Upload the module to your Magento folder.

Modify located at app/design/frontend/base/default/template/persistent/customer/form/register.phtml and add:

<div class="input-box">
     <label for="YourAttributeName"><?php echo $this->__('YourAttributeName') ?><span class="required">*</span></label><br />
    <textarea rows="4" cols="50" name="YourAttributeName" id="YourAttributeID" value="<?php echo $this->htmlEscape($this->getFormData()->getYourAttributeName()) ?>" title="<?php echo $this->__('YourAttributeName') ?>" class="required-entry input-text" ></textarea>
    </div>

If you want customer to be able to modify the attribute in customer panel, then modify app/design/frontend/base/default/template/customer/form/edit.phtm and add:

 <li>
        <label for="YourAttributeName" class="required"><em>*</em><?php echo $this->__('YourAttributeName') ?></label>
        <div class="input-box">
            <textarea rows="4" cols="50" name="YourAttributeName" id="YourAttributeID" value="<?php echo $this->htmlEscape($this->getFormData()->getYourAttributeName()) ?>" title="<?php echo $this->__('YourAttributeName') ?>" class="required-entry input-text" ></textarea>
        </div>
    </li>
clear all caches.
2
  • The question is about customer registration form not contact form. Jul 17, 2015 at 6:02
  • This doesn't upload a file this just uploads a textarea... Nov 2, 2016 at 20:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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