Jump to content

How to visit a specific cart if i know the cartId?


MaxBecode

Recommended Posts

Dear fellow Prestashop users and developers, 

I am attempting to integrate Prestashop in my Drupal site. Currently i am able to create and update a cart from my Drupal project.

 

My question is really simple, if i know the cartId, how do i send my user to his respective cart or order in Prestashop? 

 

Both Cart =  https://mysite/prestashop/en/cart?action=show

and Order =  https://mysite/prestashop/en/order

 

will send me to the Cart and Order i created myself in prestashop (i'm assuming this information is stored in a Prestashop Cookie?).

 

 

Edited by MaxBecode (see edit history)
Link to comment
Share on other sites

Ok guys don't panic, i found the answer, in Prestashop/classes/Cookie.php there is a function __set(), in that function there are key value pairs that decide what cart will be shown when you visit

Both Cart =  https://mysite/prestashop/en/cart?action=show

and Order =  https://mysite/prestashop/en/order

so by setting 

$this->_content['id_guest'] = json_decode($_COOKIE['guest'], true);

$this->_content['id_cart'] = json_decode($_COOKIE['cart'], true);

i was able to set a specific cart i wanted to show.

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...