0

How to stop customers changing password

I curently have a b2b site where I set the same password for each store. I'd like to disable "Change Password" on the account page so no one can change the password.

Magento 2.3.2 CE

Cheers.

enter image description here

  • Overwrite the template in customer_account_index.xml layout file: <referenceContainer name="content"> <block class="Magento\Customer\Block\Account\Dashboard\Info" name="customer_account_dashboard_info" as="info" template="My_OverridingModule::account/dashboard/info.phtml" cacheable="false"/></referenceContainer> – danronmoon Oct 18 '19 at 18:10
0

You have to copy

vendor/magento/module-customer/view/frontend/templates/account/dashboard/info.phtml

to

app/design/frontend/[theme_vendor]/[theme]/Magento_Customer/templates/account/dashboard/info.phtml

And remove the code

<a href="<?= $block->escapeUrl($block->getChangePasswordUrl()) ?>" class="action change-password">
   <?= $block->escapeHtml(__('Change Password')) ?>
</a>
| improve this answer | |
0

That did the trick, cheers Kishor greatly appreaited.

| improve this answer | |
  • Upvote the answer if it helps you. – Kishor Thummar Nov 14 '19 at 10:24

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.