Jump to content

[Prestashop 1.6] No CART ID in Cookie/Context object


nosnevetzy

Recommended Posts

Hello. I'm having an issue about the id_cart on the Cookie/Context object. I have a custom payment module that needs to access the Cookie/Context object from Prestashop in order to validate the order. 

Below is when I print the cookie object after purchasing an item on the shop that I'm working on. You can see that the id_cart is missing. 

2018-02-21_111112.png.f29d176da51e78e7b6952aefde10e15a.png

 

This is also happening only when the customer already visited/purchased an order to the shop. If the shop was visited for the first time, the id_cart is in the object, but when you try to purchase an order again, the id_cart is missing. I already cleared the cache from the adminpanel and even in the FTP files and I also disable it for a while to test if its the cache that causing the problem but I still facing the issue. Note that since this is a payment module, the order wasn't created yet so the cookie/context object is the only reference to get the cart_id.

 

Below is the sample code in my custom payment module that calls the global cookie object and get the id_cart. It was the first time I encountered this issue. Everything is working fine before. 

2018-02-21_111911.png.b2d1d83992b957b43204f09567968d5e.png

 

Please share your insights on this issue. It would be a big help for me.

Thanks!

Edited by nosnevetzy (see edit history)
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...