masterblaster Posted March 17, 2014 Share Posted March 17, 2014 Hello,I tried to upgrade my company installation from 1.5 to 1.6 in order to be ready for next week official release. Everything looks great except one issue : I have a couple of custom modules that rely on " displayBackOfficeHeader " hook to show some .js and HTML content on back office product pages (in information tab, under product "UPC") by returning a TPL to the hook. public function hookDisplayBackOfficeHeader($params) { global $smarty; {some_code_here} return $this->display(_FILE_, '/product_view.tpl');} After 1.6 upgrade I can't find the "hooked" content on back office, modules worked great on 1.4 and 1.5... Can you pls inform me if something has changed on this side ? Thanks. Simone Link to comment Share on other sites More sharing options...
coeos.pro Posted March 17, 2014 Share Posted March 17, 2014 try with hookdashboardZoneTwo Link to comment Share on other sites More sharing options...
masterblaster Posted March 17, 2014 Author Share Posted March 17, 2014 Hello , I tried to register the following hooks : dashboardZoneTwo dashboardZoneOne dashboardData with no luck. No data is displayed on backoffice product page. Any idea ? Link to comment Share on other sites More sharing options...
coeos.pro Posted March 17, 2014 Share Posted March 17, 2014 you must use hookdashboardZoneTwo and click on "Transplant a module" in your module or re-install it Link to comment Share on other sites More sharing options...
masterblaster Posted March 17, 2014 Author Share Posted March 17, 2014 Hello, yes I know how to transplant a hook. I did all the tests and also un-transplanted the old hook. I was thinking it could depend from the fact that my hook was returning a "tpl" : return $this->display(__FILE__, '/product_view.tpl'); But I also tried to return a string in order to test it , and nothing was displayed on backoffice. Any other suggestion ? Thank you. Link to comment Share on other sites More sharing options...
masterblaster Posted March 21, 2014 Author Share Posted March 21, 2014 Hello, I see that : dashboardZoneTwo dashboardZoneOne dashboardData are displayed on main dashboard Back office page, but not in product page. I resolved my issues by using the hook DisplayAdminProductsExtra to create a new tab and show there my content, but I have stil major issues. The hook content loads a javascript to show some dynamic HTML box, so it looks like : public function hookdisplayAdminProductsExtra($params) { ..... return $this->display(__FILE__, 'views/templates/hook/product_view.tpl'); } However , the TPL content is not showed in hook position, I also tried to load the JS file with $this->context->controller->addjs method, but same unlucky result. I also tried to load the JS in header first (hookDisplayBackOfficeHeader), it is loaded in compiled HTML but not rendered inside the hook. Note that I already checked that hook is nested properly, and that works (I tried to return an echo and it worked OK) Note that the TPL file contains some basilar Javascript code: <script type="text/javascript"> $(document).ready(function(){ var insertPoint = $("#step1 table tbody")[0]; $(insertPoint).prepend(function () { return "{some html to show a checkbox here}"; }); }) </script> The same module worked flawlessy until 1.5.6.2 version. Link to comment Share on other sites More sharing options...
Recommended Posts