Skip to main content
2 of 2
added 7 characters in body
Mohit Patel
  • 4k
  • 4
  • 24
  • 53

If your install data script successfully installed your custom attribute, now you just need to override addition information .phtml file and set your custom attribute in that.

Create Vendor/TestModule/view/frontend/layout/customer_account_create.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <referenceContainer name="form.additional.info">
        <block class="Magento\Framework\View\Element\Template" name="additional_zipcode" template="Kage_RegisterForm::form\register.phtml"/>
    </referenceContainer>
</body>
</page>

Create Vendor/TestModule/view/frontend/templates/form/register.phtml

<fieldset class="fieldset create account" data-hasrequired="<?php /* @escapeNotVerified */ echo __('* Required Fields') ?>">
    <legend class="legend"><span><?php /* @escapeNotVerified */ echo __('Additional Information') ?></span></legend>
    <p>
    <div class="field regulation">
        <label for="regulation" class="label"><span><?php /* @escapeNotVerified */
                echo __('Additional Zipcode') ?></span></label>
        <div class="control">
            <input type="text" name="additional_zipcode" id="additional_zipcode" title="<?php /* @escapeNotVerified */ echo __('Additional Zipcode') ?>" class="input-text" data-validate="{required:false}">
        </div>
    </div>
    </p>
</fieldset>

THANKS.

Mohit Patel
  • 4k
  • 4
  • 24
  • 53