Sridhar
Sridhar

Reputation: 31

how to redirect after clicking Add to Cart in Prestashop

Redirect to Login page after clicking to Add to Cart button

When client clicks on 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 some controller please help me out or is there any solutions is there in prestashop

Upvotes: 1

Views: 5867

Answers (2)

Danoosh
Danoosh

Reputation: 169

go to admin panel and follow this steps:

  1. Modules -> cart block -> configure -> disable ajax add to cart
  2. preferences -> products -> set after product added to cart to cart summary
  3. preferences -> Orders -> set order process type to "one page check-out"

Upvotes: 1

SJousse
SJousse

Reputation: 711

Use the module from this answer : https://stackoverflow.com/a/14497847/1903705

And replace the content of hookActionCartSave by your redirect.

You should add some other checks (already logged in, etc.).

Upvotes: 0

Related Questions