Jump to content

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


Marik

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!

Link to comment
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)
Link to comment
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

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 year later...
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)
Link to comment
Share on other sites

  • 2 years later...
Em 4/5/2022 em 8:23 AM, Pandal disse:

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.

Can you show me where is the static_token with a print?

Thanks

Link to comment
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
×
×
  • Create New...