Jump to content

Logout then return to index/home page


Recommended Posts

in this case is necessary to change the front controller, open the file

 

classes/controller/FrontController.php

 

in line 182 you've got

Tools::redirect(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : null);

 

In the Tools::redirect() function use the url (or Link function - it's preffered and correct method) to your homepage

Link to comment
Share on other sites

Link object is a prestashop Class which allows you to create easily links to the certain pages in your store.

for example, you have got many languages, and want to redirect user to the correct language version of the homepage, then you can use Link object and its function: getLanguageLink

 

$link->getLanguageLink();

Link to comment
Share on other sites

  • 2 months later...

Just an update on this......

 

I have turned on friendly url's and now the logout has stopped working

 

If i hover over the logout button the address is "shop/?mylogout="

 

On my test site (which hasnt got friendly url's switched on) the address on the logout button is "shop/index.php?mylogout="

and this works fine

 

 

Any ideas ??

Edited by mickeyboy1 (see edit history)
Link to comment
Share on other sites

hello mickeyboy1

 

thank you for posting url to the solution

im going to mark this thread as [solved]

btw. you can also mark own topic as solved

 

here is an instruction

 

 

 

[sOLVED] Topic
If, after posting a topic, you find a solution to your problem, please indicate it in your post and describe the solution.
Furthermore if you are the author of the topic for which a solution has been found, please edit your topic title to mark it as [sOLVED].

To mark a topic as [solved] :
- Edit the first post of your topic by clicking on the "Edit" button,
- Click on the "Use full editor" button,
- Add the "[solved]" string at the beginning of your topic title and click on the "Submit Modified Post" button.

 

with regards,

Milos

Link to comment
Share on other sites

×
×
  • Create New...