Jump to content

How to get/create token for a prestashop session


Recommended Posts

I'm trying to create a link from an external website that will directly link to an "Add to cart" page in prestashop. However, all add to cart links internal to prestashop have a "&token=blahblahblah" in their url. Without the correct token, my external link does not work (will not add to cart, because no cart exists).

 

I need a way to initializes the token/cart without first going to index.php (which is where it is normally created). How can this be accomplished?

 

Do I need to XHR (ajax) index.php in the background? It seems like a reasonable thing I'm trying to do, but no simple way to execute without resorting to this.

Link to comment
Share on other sites

Also, where is this token actually created? Cannot find it anywhere. What exactly is being tokenized? Is it the cart session, or something else?

 

Appears it is not the cart session as adding to cart from 2 different browsers using the same token value does not disturb the values. Actually, the variable in question is: "static_token", but gets placed in to the URL as "token".

Link to comment
Share on other sites

  • 2 weeks later...
  • 6 months later...
  • 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...