Jump to content
MaxBecode

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

Recommended Posts

Posted (edited)

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)

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

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