daniele dexter Posted November 4, 2022 Share Posted November 4, 2022 Hello, i have to find the variable which contains id_cart to use in a php file. This value is store in table ps_cart and ps_cart_product. I've already try to use -> $num_carrello = Tools::getValue('id_cart'); -> it didn't work.... Thank you Link to comment Share on other sites More sharing options...
Mediacom87 Posted November 4, 2022 Share Posted November 4, 2022 Hi, where do you want to get this id_cart ? If it's in front, you can get it directly in context. 1 Link to comment Share on other sites More sharing options...
ps8modules Posted November 6, 2022 Share Posted November 6, 2022 (edited) $this->context->cart->id or Context::getContext()->cart->id Edited November 6, 2022 by 4you.software (see edit history) 1 Link to comment Share on other sites More sharing options...
daniele dexter Posted November 7, 2022 Author Share Posted November 7, 2022 On 11/6/2022 at 5:09 AM, 4you.software said: $this->context->cart->id or Context::getContext()->cart->id I used the second option and it works Thank you 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