mickeyboy1 Posted July 28, 2013 Share Posted July 28, 2013 why is it that when you click logout is stays at the login screen i am using 1.5 with custom theme, although this does also this in default theme so shouldnt matter. how will i make it return to the home/index page ?? Link to comment Share on other sites More sharing options...
vekia Posted July 28, 2013 Share Posted July 28, 2013 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 More sharing options...
mickeyboy1 Posted July 29, 2013 Author Share Posted July 29, 2013 thanks for the reply vekia but im not quite sure what you mean by the "Link function" please can you explain more thanks Link to comment Share on other sites More sharing options...
vekia Posted July 29, 2013 Share Posted July 29, 2013 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 More sharing options...
mickeyboy1 Posted October 1, 2013 Author Share Posted October 1, 2013 (edited) 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 October 1, 2013 by mickeyboy1 (see edit history) Link to comment Share on other sites More sharing options...
mickeyboy1 Posted October 1, 2013 Author Share Posted October 1, 2013 I am using this code in blockuserinfo.tpl {$link->getPageLink('index', true, NULL, "mylogout") Would this code need changing if url re-writing is enabled thanks in advance mb Link to comment Share on other sites More sharing options...
mickeyboy1 Posted October 2, 2013 Author Share Posted October 2, 2013 After long searches through the forums last night i found the solution.. It was posted in another thread but this is what you need: https://github.com/PrestaShop/PrestaShop/commit/6aad506c80ee6948856587f0863b73c13eab5f2e Just change the red code for the green I am using ps version 1.5.3.1 and it was on line 581 in classes/Dispatcher.php Link to comment Share on other sites More sharing options...
mickeyboy1 Posted October 2, 2013 Author Share Posted October 2, 2013 This can now be marked as solved many thanks to vekia for all your assistance Link to comment Share on other sites More sharing options...
vekia Posted October 2, 2013 Share Posted October 2, 2013 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] TopicIf, 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 More sharing options...
Recommended Posts