gr4devel Posted August 29, 2013 Share Posted August 29, 2013 (edited) Hi community, is there a way to get the product object instantiated by the ProductController from the hookheader of a module? From the context object I can access the Controller but the product object in it is protected Edited August 29, 2013 by gr4devel (see edit history) Link to comment Share on other sites More sharing options...
Alex Simonchik BelVG Posted August 29, 2013 Share Posted August 29, 2013 (edited) Hi, interesting question, only Tools::getValue(id_product), comes to mind. Regards Edited August 29, 2013 by Alexander Simonchik (see edit history) Link to comment Share on other sites More sharing options...
gr4devel Posted August 29, 2013 Author Share Posted August 29, 2013 Thanks Alexander I appreciate your suggestion but I already know this way I was interested in a more directed way. I'll leave the post open waiting for some more suggestions. BTW thank you again buddy ! Link to comment Share on other sites More sharing options...
Alex Simonchik BelVG Posted August 29, 2013 Share Posted August 29, 2013 Ok, I will be follow this topic with interest Link to comment Share on other sites More sharing options...
Krystian Podemski Posted August 29, 2013 Share Posted August 29, 2013 (edited) Hello Check my commit here: https://github.com/P...taShop/pull/644 Just check if current controller = product and then you can use: $product_instance = $this->context->controller->getProduct() I use this also for categories, of course a whole code goes to override. Edited August 29, 2013 by Krystian Podemski (see edit history) 1 Link to comment Share on other sites More sharing options...
gr4devel Posted August 29, 2013 Author Share Posted August 29, 2013 Nice exactly what I was thinking about! I proceed to merge with the development branch! Thank you very much Krystian! And thanks again to Alexander ! 1 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