1

I need to hide password fields and generate a random password when customer register at the store, the same thing as in this post: How to generate random password for new customer while creating account in magento? I´d tried to change the inputs but they are not the same.

<div class="field password required">
            <label for="password" class="label"><span><?= $block->escapeHtml(__('Password')) ?></span></label>
            <div class="control">
                <input type="password" name="password" id="password"
                       title="<?= $block->escapeHtmlAttr(__('Password')) ?>"
                       class="input-text"
                       data-password-min-length="<?= $block->escapeHtmlAttr($block->getMinimumPasswordLength()) ?>"
                       data-password-min-character-sets="<?= $block->escapeHtmlAttr($block->getRequiredCharacterClassesNumber()) ?>"
                       data-validate="{required:true, 'validate-customer-password':true}"
                       autocomplete="off">
                <div id="password-strength-meter-container" data-role="password-strength-meter" aria-live="polite">
                    <div id="password-strength-meter" class="password-strength-meter">
                        <?= $block->escapeHtml(__('Password Strength')) ?>:
                        <span id="password-strength-meter-label" data-role="password-strength-meter-label">
                            <?= $block->escapeHtml(__('No Password')) ?>
                        </span>
                    </div>
                </div>
            </div>

        </div>
        <div class="field confirmation required">
            <label for="password-confirmation" class="label"><span><?= $block->escapeHtml(__('Confirm Password')) ?></span></label>
            <div class="control">
                <input type="password" name="password_confirmation" title="<?= $block->escapeHtmlAttr(__('Confirm Password')) ?>" id="password-confirmation" class="input-text" data-validate="{required:true, equalTo:'#password'}" autocomplete="off">
            </div>
        </div>
Teja Bhagavan Kollepara
  • 3,816
  • 5
  • 32
  • 69
  • After submitting form at server side you can right custom function to generate Rand password and set it while saving and trigger email to customer also – Pramod Kharade Apr 28 '18 at 05:39
  • Sorry Pramod, but I didn´t understand your solution. The customer is the one that is subitiming the form from its side. So, I just need to hide the password and password confirm fields from the registration form... –  Apr 28 '18 at 12:58
  • Sorry Pramod, but I didn´t understand your solution. The customer is the one that is subitiming the form from its side. So, I just need to hide the password and password confirm fields from the registration form... –  Apr 28 '18 at 12:58
  • Guys, can anyone help? Please.... –  May 01 '18 at 18:07

0 Answers0