0

how to add Company field to Magento 2 registration form https://prnt.sc/u0i06g

1 Answer 1

0

Easy way you override your file and change register.phtml

module-customer/view/frontend/templates/form/register.phtml

copy your custom theme

app/design/frontend/vendor/theme/Magento_Customer/templates/form/register.phtml

Then, add your custom field:

<div class="field required">
    <label for="custom_field" class="label"><span><?= __('CustomField') ?></span></label>
    <div class="control">
        <input type="text" name="custom_field" id="custom_field" value="<?= $block->escapeHtml($block->getFormData()->getCustomField()) ?>" title="<?= __('CustomField') ?>" class="input-text" data-validate="{required:true, 'validate-phoneStrict':true}">
    </div>
</div>

And you want to custom module. Please check this link :-

How to Add New Fields on Registration page?

After that run below command:

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy
php bin/magento cache:clean

THANKS.

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.