kizbo Posted July 20, 2018 Share Posted July 20, 2018 Hi, im working on adding additional info in the back panel of my shop, in order view panel to be exact, im starting to get it, found out how to edit template file to add my panel, but i need to query additional data from MySQL Database to fill this panel and pass this data to Smarty template. How can i achieve such thing? I figured out i can edit AdminOrdersController (override it, not direct edit ofc), but still don't really now how, because i need to create query +/- like this: `SELECT * FROM myAdditonalTable WHERE myAdditonalTable.order_id = `orderID from actual object`' I need to extract this actual object id to evaluate this, too. Hope you can help me guys. 1 Link to comment Share on other sites More sharing options...
Nishith Nesdiya Posted July 21, 2018 Share Posted July 21, 2018 Hi... i suggest you please create custom module and use register hook "displayAdminOrder" your module.then after you ca use the this fuction public function hookDisplayAdminOrder($param) { // your code here } read this i hope this help for youhttp://doc.prestashop.com/display/PS17/Hooks+in+PrestaShop+1.7.x Thanks 1 Link to comment Share on other sites More sharing options...
kizbo Posted July 23, 2018 Author Share Posted July 23, 2018 (edited) Thank you for your answer, i digged up topic in documentation, only one thing bothers me, should i hook into something on install? Or just use function you mentioned? EDIT: nevermind, i got, i need to call $this->registerHook("displayAdminOrder") in install() On 21.07.2018 at 6:14 AM, Nishith said: Hi... i suggest you please create custom module and use register hook "displayAdminOrder" your module.then after you ca use the this fuction public function hookDisplayAdminOrder($param) { // your code here } read this i hope this help for youhttp://doc.prestashop.com/display/PS17/Hooks+in+PrestaShop+1.7.x Thanks Edited July 23, 2018 by kizbo (see edit history) 1 Link to comment Share on other sites More sharing options...
Nishith Nesdiya Posted August 17, 2018 Share Posted August 17, 2018 Sorry for late reply Great you have find the solution Thanks Link to comment Share on other sites More sharing options...
BoldizArt Posted January 14, 2019 Share Posted January 14, 2019 You can use the following hooks: <?php public function install() { if ( parent::install() && $this->registerHook('displayAdminOrder') && $this->registerHook('displayAdminOrderLeft') && $this->registerHook('displayAdminOrderRight') && $this->registerHook('dsplayAdminOrderTabOrder') && $this->registerHook('displayAdminOrderContentShip') && $this->registerHook('displayAdminOrderContentOrder') ) { return true; } $this->uninstall(); return false; } /** * displayAdminOrderContentShip */ public function hookDisplayAdminOrderContentShip($param) { return '<b>hookDisplayAdminOrderContentShip</b>'; } /** * @hook displayAdminOrderLeft */ public function hookDisplayAdminOrderLeft($param) { return '<b>hookDisplayAdminOrderLeft</b>'; } /** * displayAdminOrderRight */ public function hookDisplayAdminOrderRight($param) { return '<b>hookDisplayAdminOrderRight</b>'; } /** * @hook displayAdminOrder */ public function hookDisplayAdminOrder($param) { return '<b>hookDisplayAdminOrder</b>'; } /** * displayAdminOrderContentOrder */ public function hookDisplayAdminOrderContentOrder($param) { return '<b>hookDisplayAdminOrderContentOrder</b>'; } /** * displayAdminOrderTabOrder */ public function hookDisplayAdminOrderTabOrder($param) { return '<b>hookDisplayAdminOrderTabOrder</b>'; } $orderId = $param['id_order']; $cart = $param['cart']; Check the attached picture: 1 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