Jump to content

Logout Page Redirect to Thank You (Custom Page)


aguha2050

Recommended Posts

Hello devs,

 

I am new to Prestashop, I want to redirect customers when they logout to a "Thank You" Custom Page.

 

Is there any way to do that? I'm sure there is, just need your help.

 

I'm using prestashop v1.6.0.9, deafult prestashop theme.

 

Thanks a lot...

Link to comment
Share on other sites

Hi,

 

I believe if you create an override for customer.php class (in the /override folder) with a single copy of mylogout() function

you can add this line to the end of that function after:

 

...

$this->logged = 0;

Tools::redirect('/path_to_your_custom_page');

  • Like 1
Link to comment
Share on other sites

Hi!

 

The easiest way to do this is as follows.

Go to Translations and select Translations of installed modules.
Now look up the DEFAULT BOOTSTRAP - CONFIRMATION Here you will find: For any questions or for further information, please contact our ...
 
You can now enter the PRE (For any questions or for further information, please contact OUR), for example, Thank you for your order. The end result may look like the type like this
 
 
Thank you for your order! For any questions or for further information, please contact our customer service.
 
This is just one example. You understand now what you can do and how to do it.
 
 
 
Best regards
 
MacRoy

post-413956-0-33791500-1419184142_thumb.jpg

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

assuming that you have a custom 'Thank you' CMS page, you can add the single line, mentioned before to mylogout() function in CustomerCore class.

 

You can either modify the core class directly in /classes/customer.php file or create an override of this class (to be able to update your prestashop version and still preserve the changes you made).  Look up how to create an override elsewhere and see if that's the route you'd like to take.  You only need to include the functions you change in your override class.

 

This should work regardless of whether an order was placed or not. 

Edited by eontech (see edit history)
  • Like 1
Link to comment
Share on other sites

assuming that you have a custom 'Thank you' CMS page, you can add the single line, mentioned before to mylogout() function in CustomerCore class.

 

You can either modify the core class directly in /classes/customer.php file or create an override of this class (to be able to update your prestashop version and still preserve the changes you made).  Look up how to create an override elsewhere and see if that's the route you'd like to take.  The only need to include the functions you change in your override class.

 

This should work regardless of whether an order was placed or not. 

 

 

Hi,

 

I believe if you create an override for customer.php class (in the /override folder) with a single copy of mylogout() function

you can add this line to the end of that function after:

 

...

$this->logged = 0;

Tools::redirect('/path_to_your_custom_page');

 

Thanks a lot jesus (eontech) :D

 

I got it working with little bit of practical knowledge..

.

.

.

.

 

This is for all future visitor >

 

open classes/customer.php

 

press cntrl+f and search for   mylogout()

 

copy pase this code >>>  Tools::redirect('/path_to_your_custom_page');  next to $this->logged = 0; (which is already there in customer.php)

 

replace "/path_to_your_custom_page"  with your full custom page link.. (yes full link, along with domain, else it will just redirect to home page.)

 

 

Cheers B)

Edited by aguha2050 (see edit history)
  • Like 1
Link to comment
Share on other sites

Glad to hear you got it working.  

 

You may still want to look into how to do the same thing using overrides to stop any future version upgrades from over-writing your changes.

 

At any rate, it will be useful if you marked this as solved as described here:

 

 

Serge

Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...