2
votes

I have tried to edit new customer account confirmation template in magento. But it not reflect in front end.

I have edited the layout for customer_account_confirmation in customer.xml file in theme layout folder.

I have edited customer_account_confirmation in customer.xml

<customer_account_confirmation>
        <remove name="right"/>
        <remove name="left"/>

        <reference name="root">
            <action method="setTemplate"><template>page/account_confirm.phtml</template></action>
            <action method="setHeaderTitle" translate="title" module="customer"><title>Send confirmation link</title></action>
        </reference>
    </customer_account_confirmation>

When i tried to click the confirmation link from mail it redirect to dashboard page and show confirmation message. But i need to show the thank you page for after customer click confirmation link from mail

I would like to set the thank you page in account_confirm.phtml file in template folder.But this is not working.

Can suggest me the right solution to solve this problem?

Thanks

1
have you cleared the cache before testing? Also, give a Mage::log in account_confirm.phtml, it will let you know if that template file is actually used. - Kalpesh
yes i have disabled my cache and compilation.after click the link it only redirect to account dashboard page and show the confirnation message. - Maniprakash Chinnasamy
may be something is wrong in the file. can you post the snippet of code you wrote to show the thank you page on clicking the link? - Kalpesh

1 Answers

2
votes

If I get you right, your problem is: How to change the redirect URL which gets called when a customer clicks on the confirmation link for her new account?

In this case, check for the controller which is in charge for the default redirect (which is to "dashboard"). You can find it easily by examining the URL which is given in the confirmation link, which is something like http://www.yourdomain.com/customer/account/confirm/[some params]. From here you get the controller: You are looking for the confirmAction() method, which is in the AccountController.php of the Customer Modul. At the end of this method a redirect is defined:

public function confirmAction()  {
    (...)

            // log in and send greeting email, then die happy
            $this->_getSession()->setCustomerAsLoggedIn($customer);
            $successUrl = $this->_welcomeCustomer($customer, true);
            $this->_redirectSuccess($backUrl ? $backUrl : $successUrl);
            return;

    (...)
}

So, on a succesful confirmation, the user is redirected to either the URL given in $backUrl, or, if this is not given, to the URL given in$successUrl.

The first variable $backUrl is defined inside this confirmAction() method, if the confirmation link URL contains a parameter back_url:

$backUrl = $this->getRequest()->getParam('back_url', false);

The second variable $succesUrl is returned by the _welcomeCustomer() method of the AccountController, which sets an URL pointing to the indexAction(), loading the customer's dashboard.

So, in order to change the default Magento redirect, you can either make sure that your confirmation link is created with a back_url parameter (in my case, for example, this parameter is empty); or you override the AccountController in a custom modul and make the redirect as you wish.