Jump to content

Recommended Posts

Hello Friends!

When client clicks to the button Add to Cart, he or she will be automatically redirect to the Login Page.


for Page redirection i got this




But i'm searching to past this code in which controller

please help me out

Link to comment
Share on other sites

what version of PrestaShop? this is the main reason people can't get help....there is a big difference in how to check for logged in 1.4 and 1.5...so how to help you? always post your version...


and if you are wanting to develop and can't find this sort of code in your downloaded version, then you need a better code search program...otherwise you are not going to get very far in development...or in your case hacking...:)

Link to comment
Share on other sites

I'm using PrestShop 1.5, for redirecting



if (!$this->context->customer->isLogged() && $this->php_self != 'authentication' && $this->php_self != 'password')



Above code help me to redirect if the user is not logged, [path for it is classes\controller\FrontController.php in that after the public function init() after the line parent::init()]


Now i want the code for, if some one clicks the Add to Cart, he or she will be redirected to Login Page as well as the cart count should have to be in 0.


The concepts comes like, if it is the Guest user then he or she can only view the list of product but when he clicks the Add to Cart, he or she will have to be redirected to Login Page.


Please help me out

Link to comment
Share on other sites

  • 3 years 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...