Jump to content

Customer Log in Log out buttons not working correctly


Recommended Posts

Hi,

 

I am having trouble with log in and log out buttons. When a new user creates an account on the site the login button still says login, with no apparent way to log out. When the page is refreshed, the button still says log in (it should change to log out as soon as the customer is logged in). When the user navigates to a new page the button changes to logout.

 

But now, when you click the logout button, it continues to say logout (it should now say login). In this case, neither refreshing the page nor navigating to a new page will change the logout button to a login button.

 

I have verified that clicking logout does actually log the customer out.

 

This is most likely related to to the commercial theme I am using. When I switch to the default bootstrap theme, the problem does not occur. I have also done a clean test installation of the theme on Prestashop 1.6.0.9 and the problem is the same on that site. I have filed a ticket with the theme author, but have received no response.

 

Also, the problem does not occur with a clean installation of this theme on Prestashop 1.5.4 

 

I am hoping this is a relatively simple issue that I can attempt to fix myself. Any ideas?

 

http://www.modernfrill.ca

 

Thanks.

Link to comment
Share on other sites

Thanks for taking a look at this. It works fine now because I "fixed" it by turning off template caching. However, that is not really a fix because I would like to be able to turn on template caching and still have the template work (like the default-bootstrap theme does). 

 

I am not sure exactly how much performance I lost by turning off caching, or whether it is worth the time trying to fix the theme.

Link to comment
Share on other sites

Hi, you would not want to run without smarty cache compile.  It's really a core feature of smarty and significantly helps with performance.  If the developer or re-seller of theme has support forum I would use that to describe the bug or post in job offers to get hands on review.  Let us know how you get it sorted. thanks 

Link to comment
Share on other sites

  • 2 weeks later...

I also met this status. My server is use nginx+ hhvm. I tried some times to fix it. And finally, I append a functions which was used in previous version, and it works. Here I show you the code.

 

In classes folder, Cookie.php line 222, (my version is prestashop 1.6.0.8)

 

public function logout()
{
$this->_content = array();
$this->_setcookie();
unset($_COOKIE[$this->_name]);
$this->_modified = true;
$this->write();// Append this
}
public function mylogout()
{
unset($this->_content['id_compare']);
unset($this->_content['id_customer']);
unset($this->_content['id_guest']);
unset($this->_content['is_guest']);
unset($this->_content['id_connections']);
unset($this->_content['customer_lastname']);
unset($this->_content['customer_firstname']);
unset($this->_content['passwd']);
unset($this->_content['logged']);
unset($this->_content['email']);
unset($this->_content['id_cart']);
unset($this->_content['id_address_invoice']);
unset($this->_content['id_address_delivery']);
$this->_modified = true;
$this->write();// Append this
}
Link to comment
Share on other sites

  • 2 years later...
×
×
  • Create New...