Redirect to specific page after user registers

  • Posts: 49
  • Thank you received: 2
13 years 5 months ago #18218

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

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13375
  • MODERATOR
13 years 5 months ago #18219

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.

Please Log in or Create an account to join the conversation.

  • Posts: 49
  • Thank you received: 2
13 years 5 months ago #18316

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

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13375
  • MODERATOR
13 years 5 months ago #18319

That's indeed what you should do. Add the line below after the enqueueMessage line :
$app->redirect(' mywebsite.com/my_link ');

Please Log in or Create an account to join the conversation.

  • Posts: 49
  • Thank you received: 2
13 years 5 months ago #18322

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

Please Log in or Create an account to join the conversation.

Time to create page: 0.061 seconds
Powered by Kunena Forum