Jump to content

[SOLVED] Cart URL redirect me to homepage if I am logged in


Marik
 Share

Recommended Posts

Hello,

 

I used this code: {$urls.pages.cart} to get the cart url page. If I am not logged in when I click on the button it redirect me to the cart page what is normal. But if I am logged in, even if I have products on cart or not, the button redirect me to the homepage. 

 

Any advices?

 

Thank you!

Share this post


Link to post
Share on other sites

5 hours ago, Knowband Plugins said:

What's the URL i.e. output of {$urls.pages.cart}  if user is not logged in. 

I believe it will print like http://www.example.com/cart 

Also confirm, Are you able to access the cart page if the user is not logged in?

 

Yes, that's exactly what you said.

If the user is not logged in the output is /cart and the page is working. If the user is logged in the output is /cart too, but the page is not working, when I hit the button prestashop redirects me to the homepage all the time.

It's something wrong in my code? 

 

 

EDIT: It seems that it work if you add link like the following: {$urls.pages.cart}?action=show

Edited by Marik (see edit history)

Share this post


Link to post
Share on other sites

  • Marik changed the title to [SOLVED] Cart URL redirect me to homepage if I am logged in
  • 2 years later...

Hi, same problem here, but I can't find the .tpl file to change that thing. I am using a sticky cart module, and it is very difficult to me to find the location. 

 

There is something similar in www/themes/mytheme/templates/checkout/_partials/cart-detailed-actions.tpl 
But it looks ok there. {$urls.pages.order}, so it must be somewhere else.

 

Any help, please?

Al Sampedro from calcetines.com

Share this post


Link to post
Share on other sites

  • 2 weeks later...
  • 1 year later...
Posted (edited)
On 10/16/2020 at 11:39 AM, Samantha66 said:

Hello everyone,

I solved this problem by disabled token on front office in Prestashop's general settings.

 

Something goes wrong within the "static_token" placed in the add to cart form that triggers the ajax request. 
Your suggestion is right, it helped me, but that's not the "right way" of fixing this. 
Anyway I'm tired of fixing prestashop bugs so I'll leave the token on front-office disabled.

Thank you.

Edited by Pandal (see edit history)

Share this post


Link to post
Share on other sites

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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More