I have my store set up so an account is created for every order (unless the email address already exists in which case the order gets added to the corresponding email addresses account) i would like to give my customers the ability to set the password for their new account on the success page since the account has already been created (without a password) how could I do that? i tried resetting the password with a form like this on the success page

<form action="https://mystore.com/customer/account/resetpasswordpost/?id=<?php echo $order->getCustomerId() ?>&amp;token=......." method="post" id="form-validate">
    <label for="password" class="required"><em>*</em>New Password</label>
        <div class="input-box">
            <input type="password" class="input-text required-entry validate-password" name="password" id="password"></div>
        <label for="confirmation" class="required"><em>*</em>Confirm New Password</label>
            <div class="input-box">
                <input type="password" class="input-text required-entry validate-cpassword" name="confirmation" id="confirmation">
        <button type="submit" title="Reset a Password" class="button"><span><span>Create A Password</span></span></button>

but i need a way to get the tokens value any thoughts? thanks

  • You can use editPostAction function instead from account controller, that way, you'd just be replicating how you change password from my account section.
    – Prateek
    Mar 10, 2016 at 14:23

1 Answer 1


I got the code to get a token

   $order = Mage::getModel('sales/order')->loadByIncrementId($this->getOrderId());
    $customer = Mage::getModel('customer/customer')
    $newResetPasswordLinkToken = Mage::helper('customer')->generateResetPasswordLinkToken();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.