Cristhian Chavez Posted November 25, 2020 Share Posted November 25, 2020 Hello, my query is the following I am making an api at the end of the cart just at the moment before finalizing the purchase I need to know how I can get the products that are in the cart. Be it the id, the name or something, I have tried looking at the global variables but there is none where the cart data is stored. The only thing I want is the product data, the total, subtotal and the customer data I already have. Thank you. My PS version is 1.7. Link to comment Share on other sites More sharing options...
JBW Posted November 26, 2020 Share Posted November 26, 2020 Inside a controller you can use $this->context->cart, outside use Context::getContext() to get the Context first. If you are using a hook, the cart with be inside the parameters, Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now