sridhar2do Posted February 1, 2013 Share Posted February 1, 2013 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 Tools::redirect('index.php?controller=authentication?back=my-account'); But i'm searching to past this code in which controller please help me out Link to comment Share on other sites More sharing options...
sridhar2do Posted February 1, 2013 Author Share Posted February 1, 2013 Why no one is replying to my query Link to comment Share on other sites More sharing options...
PotionsFactory Posted February 2, 2013 Share Posted February 2, 2013 Do you want to allow the item to be added to the cart or do you want the user to have to readd the product? Link to comment Share on other sites More sharing options...
sridhar2do Posted February 2, 2013 Author Share Posted February 2, 2013 Do you want to allow the item to be added to the cart or do you want the user to have to readd the product? When clicking Add to Cart button, i need to verify if the customer is already logged or not, if not i need to redirect to Login Page Link to comment Share on other sites More sharing options...
El Patron Posted February 2, 2013 Share Posted February 2, 2013 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 More sharing options...
sridhar2do Posted February 4, 2013 Author Share Posted February 4, 2013 I'm using PrestShop 1.5, for redirecting if (!$this->context->customer->isLogged() && $this->php_self != 'authentication' && $this->php_self != 'password') Tools::redirect('index.php?controller=authentication?back=my-account'); 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 More sharing options...
akshyadeep Posted January 4, 2017 Share Posted January 4, 2017 I am looking for same, found any solution? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now