Active Posted July 25, 2018 Share Posted July 25, 2018 In 1.6 it was easy to get id_product like this: Tools::getValue('id_product'); In previous versions of 1.7 it was more complicated, but still possible: global $kernel; $id = $kernel->getContainer()->get('request')->get('id'); But in PS 1.7.4.1 it doesn't work. So, is there any standard way to get ID of current product, except relying on $SERVER['REQUEST_URI']? Link to comment Share on other sites More sharing options...
Active Posted July 28, 2018 Author Share Posted July 28, 2018 14 hours ago, ndiaga said: Did you use $params ? Yes, I tried to use $params, but it contains only 3 items: cookie, cart and altern, and none of these contains id_product Link to comment Share on other sites More sharing options...
Knowband Plugins Posted August 10, 2018 Share Posted August 10, 2018 Hi, You can use the hookDisplayAdminProductsExtra() function instead of hookDisplayBackOfficeHeader() function to find the id_product and then perform the necessary action. public function hookDisplayAdminProductsExtra($params) { $id_product = $params['id_product']; if (!$id_product) { return; } else { //perform action } } Hope it will help. 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