Registration Submit Redirect HELP

We want to change the page that you are redirected to when you submit the register form. Right now it brings up the Profile Edit page. We want the registration to redirect to a URL pointing to a custom confirmation page.



Can someone tell me which file handles (and even where in the file) the redirection on the registration form successful submit?

Took a while but I figured it out. Will post my solution in case anyone else needs to do this. CS-Cart really doesn’t make sense to just redirect to the Profile Edit page on a register. Yes, they display in a green box up in top right that account was created, but some people won’t even notice that.



the code is in controllers/common/profiles.post.php



The line is:



```php return array(CONTROLLER_STATUS_OK, “$index_script?dispatch=profiles.” . $suffix); ```



What I did is in the skins customer/views/profile you can add a hidden form field variable:







Then in profiles.post.php just change that code to be in an if then else like this:



```php if ($_POST[‘register’])

{

return array(CONTROLLER_STATUS_OK, “$index_script?dispatch=pages.view&page_id=27”);

}

else

{

return array(CONTROLLER_STATUS_OK, “$index_script?dispatch=profiles.” . $suffix);

} ```



This example redirects to view page id 27 which is a nice MY ACCOUNT page that we created that has options to Edit Profile, View Orders, Request RMA, etc. (We don’t put these links in the sidebar like the stock site.)



We could add and if statement in the tpl to say ‘Thank you for registering’ too if we add ®ister=y to the redirect.

I too figured out a very easy tweak for this issue.



Instead of staying on profile update, I redirect to view cart which will be empty and has a “continue shopping” link at the bottom.



I did it through a custom hook controller, so no core file touched.



Location \addons\my_changes\controllers\common\profiles.pre.php



code :


```php

/*
* @author Shikhar shikhar.kr@gmail.com
* the pre controller hooks set redirect url if its empty,
* so that user get redirected to cart page instead of staying on the update profile page
*
*
*/
if ($_SERVER['REQUEST_METHOD'] == 'POST') {

if ($mode == 'update'){
if (empty($_REQUEST['return_url'])) {

$_REQUEST['return_url'] = "$index_script?dispatch=checkout.cart" ;

}
}


}
?> ```

profiles.pre.php

Shikhar,

Will this work for for the latest Ultimate Version?



Thanks

Websmart,



I wouldn't know as I haven't used ultimate version. But its simple and should work. Just try out.



regds,

Shikhar