- Posts: 49
- Thank you received: 2
Redirect to specific page after user registers
15 years 3 months ago #18218
by robjen
Redirect to specific page after user registers was created by robjen
Hello,
After a user registers I would like to be able to send them to the product page, where they can continue their purchase.
At the moment, after a user registers they are taken to a page that is blank - has no content - except for the system message thanking them for registering.
Below that message is an unfriendly and confusing white space.
I would like that message to appear on a product page where they can continue with their purchase.
Would appreciate your help on how to do that.
Kind regards,
Robin
After a user registers I would like to be able to send them to the product page, where they can continue their purchase.
At the moment, after a user registers they are taken to a page that is blank - has no content - except for the system message thanking them for registering.
Below that message is an unfriendly and confusing white space.
I would like that message to appear on a product page where they can continue with their purchase.
Would appreciate your help on how to do that.
Kind regards,
Robin
Please Log in or Create an account to join the conversation.
15 years 3 months ago #18219
by nicolas
Replied by nicolas on topic Re: Redirect to specific page after user registers
Hi,
You can edit the file components/com_hikashop/controllers/user.php and change the function register to add a redirect to where you want.
You can edit the file components/com_hikashop/controllers/user.php and change the function register to add a redirect to where you want.
Please Log in or Create an account to join the conversation.
15 years 3 months ago #18316
by robjen
Replied by robjen on topic Re: Redirect to specific page after user registers
Hello Nicolas,
I'm not too good at PHP coding - I tried a number of things but can't get it to work.
This is probably the code block you are referring to. I tried adding a line below the second $app line using redirect code that was further down in the block and changing it to suit. But no luck.
}
function register(){
$class = hikashop::get('class.user');
$status = $class->register($this,'user');
if($status){
$app=&JFactory::getApplication();
$app->enqueueMessage(JText::sprintf('THANK_YOU_FOR_REGISTERING',HIKASHOP_LIVE));
}
return true;
Would you mind adding the correct code for me so that the user (after registering) can be taken to a page named 'Products'.
Your help is appreciated.
Kind regards,
Robin
I'm not too good at PHP coding - I tried a number of things but can't get it to work.
This is probably the code block you are referring to. I tried adding a line below the second $app line using redirect code that was further down in the block and changing it to suit. But no luck.
}
function register(){
$class = hikashop::get('class.user');
$status = $class->register($this,'user');
if($status){
$app=&JFactory::getApplication();
$app->enqueueMessage(JText::sprintf('THANK_YOU_FOR_REGISTERING',HIKASHOP_LIVE));
}
return true;
Would you mind adding the correct code for me so that the user (after registering) can be taken to a page named 'Products'.
Your help is appreciated.
Kind regards,
Robin
Please Log in or Create an account to join the conversation.
15 years 3 months ago #18319
by nicolas
Replied by nicolas on topic Re: Redirect to specific page after user registers
That's indeed what you should do. Add the line below after the enqueueMessage line :
$app->redirect(' mywebsite.com/my_link ');
$app->redirect(' mywebsite.com/my_link ');
Please Log in or Create an account to join the conversation.
15 years 3 months ago #18322
by robjen
Replied by robjen on topic Re: Redirect to specific page after user registers
Hello Nicolas,
That solved the problem. It looks so easy when you know how. Thanks for your help.
I'm sure I'll be back again looking for another answer to something.
Kind regards,
Robin
That solved the problem. It looks so easy when you know how. Thanks for your help.
I'm sure I'll be back again looking for another answer to something.
Kind regards,
Robin
Please Log in or Create an account to join the conversation.
Time to create page: 0.215 seconds