0

I am trying to figure out how I can stop certain customer groups from changing their password. I was able to easily remove the link from the dashboard page but I can't figure out how to replicate this idea for the Forgot Password link on the login page. I attempted to create a custom block for the Forgot Password email, but it is not working. This is what I have in the block phtml template:

<?php $groupId = Mage::getSingleton('customer/customer')->getCustomerGroupId() ?>
  <?php if ($groupId != 4): ?>
    Show link
  <?php else :?>
    Don't show link
  <?php endif ?>

How can I get this to work so the customer group 4 doesn't receive an email with the option to change their password?

1

Since users viewing the login page are not yet logged in there isn't any way for them to have a customer group. I don't think this approach can work for you.

I would try creating an observer that attaches to the controller_action_predispatch_customer_account_forgotpasswordpost event. There you should be able to access the posted email address and get the customer group.

  • This approach should also prevent you from having to make and maintain changes to a bunch of templates. – Dave Franks Feb 10 '16 at 21:52

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.